Skip to content

Commit

Permalink
Added webtorrent compile option
Browse files Browse the repository at this point in the history
  • Loading branch information
paullouisageneau committed Nov 25, 2019
1 parent c0af193 commit 850fd91
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ rule sanitizer-options ( properties * )
local sanitizers ;
local extra ;
local flags ;

# sanitize is a clang and GCC feature
if <toolset>clang in $(properties)
{
Expand Down Expand Up @@ -460,6 +460,10 @@ feature i2p : on off : composite propagated ;
feature.compose <i2p>on : <define>TORRENT_USE_I2P=1 ;
feature.compose <i2p>off : <define>TORRENT_USE_I2P=0 ;

feature webtorrent : on off : composite propagated ;
feature.compose <webtorrent>on : <define>TORRENT_USE_RTC=1 ;
feature.compose <webtorrent>off : <define>TORRENT_USE_RTC=0 ;

feature iconv : auto on off : composite propagated ;
feature.compose <iconv>on : <define>TORRENT_USE_ICONV=1 ;
feature.compose <iconv>off : <define>TORRENT_USE_ICONV=0 ;
Expand Down
5 changes: 5 additions & 0 deletions include/libtorrent/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 850fd91

Please sign in to comment.