forked from paullouisageneau/libdatachannel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJamfile
236 lines (211 loc) · 6.65 KB
/
Jamfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
import feature : feature ;
project libdatachannel ;
path-constant CWD : . ;
feature gnutls : off on : composite propagated ;
feature.compose <gnutls>off
: <define>USE_GNUTLS=0 ;
feature.compose <gnutls>on
: <define>USE_GNUTLS=1 ;
lib libdatachannel
: # sources
[ glob ./src/*.cpp ]
: # requirements
<cxxstd>17
<include>./include/rtc
<define>USE_JUICE=1
<define>RTC_ENABLE_MEDIA=0
<define>RTC_ENABLE_WEBSOCKET=0
<toolset>msvc:<define>WIN32_LEAN_AND_MEAN
<toolset>msvc:<define>NOMINMAX
<toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
<toolset>msvc:<define>_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
<library>/libdatachannel//usrsctp
<library>/libdatachannel//juice
<library>/libdatachannel//plog
<gnutls>on:<library>gnutls/<link>shared
<gnutls>off:<library>ssl
<gnutls>off:<library>crypto
: # default build
<link>static
: # usage requirements
<include>./include
<library>/libdatachannel//plog
<toolset>gcc:<cxxflags>"-pthread -Wno-pedantic -Wno-unused-parameter -Wno-unused-variable"
<toolset>clang:<cxxflags>"-pthread -Wno-pedantic -Wno-unused-parameter -Wno-unused-variable"
;
alias plog
: # no sources
: # no build requirements
: # no default build
: # usage requirements
<include>./deps/plog/include
;
alias usrsctp
: # no sources
: # no build requirements
: # no default build
: # usage requirements
<include>./deps/usrsctp/usrsctplib
<library>libusrsctp.a
;
alias usrsctp
: # no sources
: <toolset>msvc
: # no default build
: # usage requirements
<include>./deps/usrsctp/usrsctplib
<library>usrsctp.lib
;
alias juice
: # no sources
: # no build requirements
: # no default build
: # usage requirements
<include>./deps/libjuice/include
<library>libjuice-static.a
<gnutls>on:<library>nettle
;
alias juice
: # no sources
: <toolset>msvc
: # no default build
: # usage requirements
<include>./deps/libjuice/include
<library>juice-static.lib
;
make libusrsctp.a : : @make_libusrsctp ;
make usrsctp.lib : : @make_libusrsctp_msvc ;
actions make_libusrsctp
{
(cd $(CWD)/deps/usrsctp && mkdir build && cd build && cmake -DCMAKE_C_FLAGS="-fPIC" .. && make -j2 usrsctp-static)
cp $(CWD)/deps/usrsctp/build/usrsctplib/libusrsctp.a $(<)
}
actions make_libusrsctp_msvc
{
SET OLDD=%CD%
cd $(CWD)/deps/usrsctp
mkdir build
cd build
cmake -G "Visual Studio 16 2019" ..
cd build
msbuild usrsctplib.sln /property:Configuration=Release
cd %OLDD%
cp $(CWD)/deps/usrsctp/build/usrsctplib/Release/usrsctp.lib $(<)
}
make libjuice-static.a : : @make_libjuice ;
make juice-static.lib : : @make_libjuice_msvc ;
rule make_libjuice ( targets * : sources * : properties * )
{
if <gnutls>on in $(properties)
{
CMAKEOPTS on $(targets) = "-DUSE_NETTLE=1" ;
}
else {
local OPENSSL_INCLUDE = [ feature.get-values <openssl-include> : $(properties) ] ;
if <target-os>darwin in $(properties) && $(OPENSSL_INCLUDE) = ""
{
# on macOS, default to pick up openssl from the homebrew installation
# brew install openssl
OPENSSL_INCLUDE = /usr/local/opt/openssl/include ;
}
CMAKEOPTS on $(targets) = "-DUSE_NETTLE=0" ;
if $(OPENSSL_INCLUDE) != ""
{
CMAKEOPTS on $(targets) += " -DOPENSSL_ROOT_DIR=$(OPENSSL_INCLUDE)/.." ;
}
}
}
actions make_libjuice
{
(cd $(CWD)/deps/libjuice && mkdir build && cd build && cmake -DCMAKE_C_FLAGS="-fPIC" $(CMAKEOPTS) .. && make -j2 juice-static)
cp $(CWD)/deps/libjuice/build/libjuice-static.a $(<)
}
rule make_libjuice_msvc ( targets * : sources * : properties * )
{
if <gnutls>on in $(properties)
{
CMAKEOPTS on $(targets) = "-DUSE_NETTLE=1" ;
}
else
{
CMAKEOPTS on $(targets) = "-DUSE_NETTLE=0" ;
}
}
actions make_libjuice_msvc
{
SET OLDD=%CD%
cd $(CWD)/deps/libjuice
mkdir build
cd build
cmake -G "Visual Studio 16 2019" $(CMAKEOPTS) ..
msbuild libjuice.sln /property:Configuration=Release
cd %OLDD%
cp $(CWD)/deps/libjuice/build/Release/juice-static.lib $(<)
}
# the search path to pick up the openssl libraries from. This is the <search>
# property of those libraries
rule openssl-lib-path ( properties * )
{
local OPENSSL_LIB = [ feature.get-values <openssl-lib> : $(properties) ] ;
if <target-os>darwin in $(properties) && $(OPENSSL_LIB) = ""
{
# on macOS, default to pick up openssl from the homebrew installation
# brew install openssl
OPENSSL_LIB = /usr/local/opt/openssl/lib ;
}
else if <target-os>windows in $(properties) && $(OPENSSL_LIB) = ""
{
# on windows, assume openssl is installed to c:\OpenSSL-Win32
if <address-model>64 in $(properties)
{ OPENSSL_LIB = c:\\OpenSSL-Win64\\lib ; }
else
{ OPENSSL_LIB = c:\\OpenSSL-Win32\\lib ; }
}
local result ;
result += <search>$(OPENSSL_LIB) ;
return $(result) ;
}
# the include path to pick up openssl headers from. This is the
# usage-requirement for the openssl-related libraries
rule openssl-include-path ( properties * )
{
local OPENSSL_INCLUDE = [ feature.get-values <openssl-include> : $(properties) ] ;
if <target-os>darwin in $(properties) && $(OPENSSL_INCLUDE) = ""
{
# on macOS, default to pick up openssl from the homebrew installation
# brew install openssl
OPENSSL_INCLUDE = /usr/local/opt/openssl/include ;
}
else if <target-os>windows in $(properties) && $(OPENSSL_INCLUDE) = ""
{
# on windows, assume openssl is installed to c:\OpenSSL-Win32
if <address-model>64 in $(properties)
{ OPENSSL_INCLUDE = c:\\OpenSSL-Win64\\include ; }
else
{ OPENSSL_INCLUDE = c:\\OpenSSL-Win32\\include ; }
}
local result ;
result += <include>$(OPENSSL_INCLUDE) ;
return $(result) ;
}
# libraries for OpenSSL on Windows
lib advapi32 : : <name>advapi32 ;
lib user32 : : <name>user32 ;
lib shell32 : : <name>shell32 ;
lib gdi32 : : <name>gdi32 ;
lib bcrypt : : <name>bcrypt ;
lib z : : <link>shared <name>z ;
alias ssl-deps : advapi32 user32 shell32 gdi32 ;
# OpenSSL on Windows
lib crypto : ssl-deps : <toolset>msvc <openssl-version>1.1 <name>libcrypto
<conditional>@openssl-lib-path : : <conditional>@openssl-include-path ;
lib ssl : ssl-deps : <toolset>msvc <openssl-version>1.1 <name>libssl <use>crypto
<conditional>@openssl-lib-path : : <conditional>@openssl-include-path ;
# OpenSSL on other platforms
lib crypto : : <name>crypto <use>z <conditional>@openssl-lib-path : :
<conditional>@openssl-include-path ;
lib ssl : : <name>ssl <use>crypto <conditional>@openssl-lib-path : :
<conditional>@openssl-include-path ;
# GnuTLS
lib gnutls : : <link>shared <name>gnutls ;
lib nettle : : <link>shared <name>nettle ;