Jamfile 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. import feature : feature ;
  2. project libdatachannel ;
  3. path-constant CWD : . ;
  4. lib libdatachannel
  5. : # sources
  6. [ glob ./src/*.cpp ]
  7. : # requirements
  8. <cxxstd>17
  9. <include>./include/rtc
  10. <define>USE_JUICE=1
  11. <define>RTC_ENABLE_MEDIA=0
  12. <define>RTC_ENABLE_WEBSOCKET=0
  13. <library>/libdatachannel//usrsctp
  14. <library>/libdatachannel//juice
  15. <library>/libdatachannel//plog
  16. : # default build
  17. <link>static
  18. : # usage requirements
  19. <include>./include
  20. <library>/libdatachannel//plog
  21. <toolset>gcc:<cxxflags>"-pthread -Wno-pedantic -Wno-unused-parameter -Wno-unused-variable"
  22. <toolset>clang:<cxxflags>"-pthread -Wno-pedantic -Wno-unused-parameter -Wno-unused-variable"
  23. <toolset>msvc:<cxxflags>"-DWIN32_LEAN_AND_MEAN -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS -D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING"
  24. ;
  25. feature gnutls : off on : composite propagated ;
  26. feature.compose <gnutls>off
  27. : <define>USE_GNUTLS=0 ;
  28. feature.compose <gnutls>on
  29. : <define>USE_GNUTLS=1 ;
  30. alias plog
  31. : # no sources
  32. : # no build requirements
  33. : # no default build
  34. : # usage requirements
  35. <include>./deps/plog/include
  36. ;
  37. alias usrsctp
  38. : # no sources
  39. : # no build requirements
  40. : # no default build
  41. : # usage requirements
  42. <include>./deps/usrsctp/usrsctplib
  43. <library>libusrsctp.a
  44. ;
  45. alias usrsctp
  46. : # no sources
  47. : <toolset>msvc
  48. : # no default build
  49. : # usage requirements
  50. <include>./deps/usrsctp/usrsctplib
  51. <library>libusrsctp.lib
  52. ;
  53. alias juice
  54. : # no sources
  55. : # no build requirements
  56. : # no default build
  57. : # usage requirements
  58. <include>./deps/libjuice/include
  59. <library>libjuice-static.a
  60. ;
  61. alias juice
  62. : # no sources
  63. : <toolset>msvc
  64. : # no default build
  65. : # usage requirements
  66. <include>./deps/libjuice/include
  67. <library>libjuice-static.lib
  68. ;
  69. make libusrsctp.a : : @make_libusrsctp ;
  70. make libusrsctp.lib : : @make_libusrsctp_msvc ;
  71. actions make_libusrsctp
  72. {
  73. (cd $(CWD)/deps/usrsctp && cmake -B build -D CMAKE_C_FLAGS="-fPIC" && cd build && make -j2 usrsctplib-static)
  74. cp $(CWD)/deps/usrsctp/build/usrsctplib/libusrsctp.a $(<)
  75. }
  76. actions make_libusrsctp_msvc
  77. {
  78. (cd $(CWD)/deps/usrsctp && cmake -B build -G "NMake Makefiles" && cd build && nmake usrsctplib-static)
  79. cp $(CWD)/deps/usrsctp/build/usrsctplib/libusrsctp.lib $(<)
  80. }
  81. make libjuice-static.a : : @make_libjuice ;
  82. make libjuice-static.lib : : @make_libjuice_msvc ;
  83. rule make_libjuice ( targets * : sources * : properties * )
  84. {
  85. if <crypto>gnutls in $(properties)
  86. {
  87. CMAKEOPTS on $(targets) = "-D USE_NETTLE=1" ;
  88. }
  89. else
  90. {
  91. CMAKEOPTS on $(targets) = "-D USE_NETTLE=0" ;
  92. }
  93. }
  94. actions make_libjuice
  95. {
  96. (cd $(CWD)/deps/libjuice && cmake -B build -D CMAKE_C_FLAGS="-fPIC" $(CMAKEOPTS) && cd build && make -j2 juice-static)
  97. cp $(CWD)/deps/libjuice/build/libjuice-static.a $(<)
  98. }
  99. rule make_libjuice_msvc ( targets * : sources * : properties * )
  100. {
  101. if <crypto>gnutls in $(properties)
  102. {
  103. CMAKEOPTS on $(targets) = "-D USE_NETTLE=1" ;
  104. }
  105. else
  106. {
  107. CMAKEOPTS on $(targets) = "-D USE_NETTLE=0" ;
  108. }
  109. }
  110. actions make_libjuice_msvc
  111. {
  112. (cd $(CWD)/deps/libjuice && cmake -B build -G "NMake Makefiles" $(CMAKEOPTS) && cd build && nmake juice-static)
  113. cp $(CWD)/deps/libjuice/build/libjuice-static.lib $(<)
  114. }