import feature : feature ; project libdatachannel ; path-constant CWD : . ; lib libdatachannel : # sources [ glob ./src/*.cpp ] : # requirements 17 ./include/rtc USE_JUICE=1 RTC_ENABLE_MEDIA=0 RTC_ENABLE_WEBSOCKET=0 /libdatachannel//usrsctp /libdatachannel//juice /libdatachannel//plog : # default build static : # usage requirements ./include /libdatachannel//plog gcc:"-pthread -Wno-pedantic -Wno-unused-parameter -Wno-unused-variable" clang:"-pthread -Wno-pedantic -Wno-unused-parameter -Wno-unused-variable" ; feature gnutls : off on : composite propagated ; feature.compose off : USE_GNUTLS=0 ; feature.compose on : USE_GNUTLS=1 ; alias plog : # no sources : # no build requirements : # no default build : # usage requirements ./deps/plog/include ; alias usrsctp : # no sources : # no build requirements : # no default build : # usage requirements ./deps/usrsctp/usrsctplib libusrsctp.a ; alias usrsctp : # no sources : msvc : # no default build : # usage requirements ./deps/usrsctp/usrsctplib libusrsctp.lib ; alias juice : # no sources : # no build requirements : # no default build : # usage requirements ./deps/libjuice/include libjuice-static.a ; alias juice : # no sources : msvc : # no default build : # usage requirements ./deps/libjuice/include libjuice-static.lib ; make libusrsctp.a : : @make_libusrsctp ; make libusrsctp.lib : : @make_libusrsctp_msvc ; actions make_libusrsctp { (cd $(CWD)/deps/usrsctp && cmake -B build -D CMAKE_C_FLAGS="-fPIC" && cd build && make -j2 usrsctplib-static) cp $(CWD)/deps/usrsctp/build/usrsctplib/libusrsctp.a $(<) } actions make_libusrsctp_msvc { (cd $(CWD)/deps/usrsctp && cmake -B build -G "NMake Makefiles" && cd build && nmake usrsctplib-static) cp $(CWD)/deps/usrsctp/build/usrsctplib/libusrsctp.lib $(<) } make libjuice-static.a : : @make_libjuice ; make libjuice-static.lib : : @make_libjuice_msvc ; rule make_libjuice ( targets * : sources * : properties * ) { if gnutls in $(properties) { CMAKEOPTS on $(targets) = "-D USE_NETTLE=1" ; } else { CMAKEOPTS on $(targets) = "-D USE_NETTLE=0" ; } } actions make_libjuice { (cd $(CWD)/deps/libjuice && cmake -B build -D CMAKE_C_FLAGS="-fPIC" $(CMAKEOPTS) && cd build && make -j2 juice-static) cp $(CWD)/deps/libjuice/build/libjuice-static.a $(<) } rule make_libjuice_msvc ( targets * : sources * : properties * ) { if gnutls in $(properties) { CMAKEOPTS on $(targets) = "-D USE_NETTLE=1" ; } else { CMAKEOPTS on $(targets) = "-D USE_NETTLE=0" ; } } actions make_libjuice_msvc { (cd $(CWD)/deps/libjuice && cmake -B build -G "NMake Makefiles" $(CMAKEOPTS) && cd build && nmake juice-static) cp $(CWD)/deps/libjuice/build/libjuice-static.lib $(<) }