diff --git a/CMakeLists.txt b/CMakeLists.txt index 5fba60719b..4623010878 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,8 +17,6 @@ include(GeneratePkgConfig) add_subdirectory(deps/libdatachannel EXCLUDE_FROM_ALL) add_subdirectory(deps/json EXCLUDE_FROM_ALL) -add_definitions(-DTORRENT_USE_RTC=1) - set(libtorrent_include_files add_torrent_params address @@ -536,7 +534,7 @@ add_library(torrent-rasterbar ${libtorrent_aux_include_files} ) -set_property(TARGET torrent-rasterbar PROPERTY CXX_STANDARD 17) +select_cxx_standard(torrent-rasterbar 17) if (BUILD_SHARED_LIBS) target_compile_definitions(torrent-rasterbar @@ -632,6 +630,8 @@ target_optional_compile_definitions(torrent-rasterbar PUBLIC FEATURE NAME extens DESCRIPTION "Enables protocol extensions" DISABLED TORRENT_DISABLE_EXTENSIONS) target_optional_compile_definitions(torrent-rasterbar PUBLIC FEATURE NAME i2p DEFAULT ON DESCRIPTION "build with I2P support" DISABLED TORRENT_USE_I2P=0) +target_optional_compile_definitions(torrent-rasterbar PUBLIC FEATURE NAME webtorrent DEFAULT ON + DESCRIPTION "build with WebTorrent support" DISABLED TORRENT_USE_RTC=0) target_optional_compile_definitions(torrent-rasterbar PUBLIC FEATURE NAME logging DEFAULT ON DESCRIPTION "build with logging" DISABLED TORRENT_DISABLE_LOGGING) target_optional_compile_definitions(torrent-rasterbar PUBLIC FEATURE NAME mutable-torrents DEFAULT ON diff --git a/Jamfile b/Jamfile index 813a0b7547..927ff16c37 100644 --- a/Jamfile +++ b/Jamfile @@ -406,7 +406,7 @@ rule sanitizer-options ( properties * ) local sanitizers ; local extra ; local flags ; - + # sanitize is a clang and GCC feature if clang in $(properties) { @@ -460,6 +460,10 @@ feature i2p : on off : composite propagated ; feature.compose on : TORRENT_USE_I2P=1 ; feature.compose off : TORRENT_USE_I2P=0 ; +feature webtorrent : on off : composite propagated ; +feature.compose on : TORRENT_USE_RTC=1 ; +feature.compose off : TORRENT_USE_RTC=0 ; + feature iconv : auto on off : composite propagated ; feature.compose on : TORRENT_USE_ICONV=1 ; feature.compose off : TORRENT_USE_ICONV=0 ; diff --git a/include/libtorrent/config.hpp b/include/libtorrent/config.hpp index 2edb105219..15c52c5409 100644 --- a/include/libtorrent/config.hpp +++ b/include/libtorrent/config.hpp @@ -123,6 +123,7 @@ POSSIBILITY OF SUCH DAMAGE. // (disables some float-dependent APIs) #define TORRENT_NO_FPU 1 #define TORRENT_USE_I2P 0 +#define TORRENT_USE_RTC 0 #ifndef TORRENT_USE_ICONV #define TORRENT_USE_ICONV 0 #endif @@ -513,6 +514,10 @@ POSSIBILITY OF SUCH DAMAGE. #define TORRENT_USE_I2P 1 #endif +#ifndef TORRENT_USE_RTC +#define TORRENT_USE_RTC 1 +#endif + #ifndef TORRENT_HAS_SYMLINK #define TORRENT_HAS_SYMLINK 0 #endif