forked from warmcat/libwebsockets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists-implied-options.txt
455 lines (386 loc) · 11.3 KB
/
CMakeLists-implied-options.txt
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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
#
# libwebsockets - small server side websockets and web server implementation
#
# Copyright (C) 2010 - 2020 Andy Green <andy@warmcat.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# This part of the CMakeLists.txt defines internal logic between options
if(IOS)
set(LWS_DETECTED_PLAT_IOS 1)
endif()
# Workaround for ESP-IDF
# Detect ESP_PLATFORM environment flag, if exist, set LWS_WITH_ESP32.
# Otherwise the user may not be able to run configuration ESP-IDF in the first time.
if (ESP_PLATFORM)
message(STATUS "ESP-IDF enabled")
set(LWS_WITH_ESP32 ON)
set(LWS_WITH_ZLIB OFF)
set(LWS_HAVE_mbedtls_ssl_get_alpn_protocol 1)
else()
set(LWS_WITH_ESP32_HELPER OFF)
endif()
if (LWS_WITH_ESP32)
set(LWS_PLAT_FREERTOS 1)
endif()
if (LWS_PLAT_OPTEE)
set(LWS_WITH_UDP 0)
endif()
if (LWS_PLAT_FREERTOS OR (${CMAKE_SYSTEM_NAME} MATCHES "QNX"))
message(STATUS "No LWS_WITH_DIR or LWS_WITH_LEJP_CONF")
set(LWS_WITH_DIR OFF)
set(LWS_WITH_LEJP_CONF OFF)
message("LWS_WITH_DIR ${LWS_WITH_DIR}")
else()
message(STATUS "Compiled with LWS_WITH_DIR and LWS_WITH_LEJP_CONF")
set(LWS_WITH_DIR ON)
set(LWS_WITH_LEJP_CONF ON)
endif()
if (LWS_FOR_GITOHASHI)
set(LWS_WITH_THREADPOOL 1)
set(LWS_WITH_HTTP2 1)
set(LWS_UNIX_SOCK 1)
set(LWS_WITH_HTTP_PROXY 1)
set(LWS_WITH_FTS 1)
set(LWS_WITH_DISKCACHE 1)
set(LWS_WITH_LWSAC 1)
set(LWS_WITH_LEJP_CONF 1)
set(LWS_WITH_SPAWN 1)
set(LWS_WITH_FSMOUNT 1)
set(LWS_WITH_STRUCT_JSON 1)
set(LWS_WITH_STRUCT_SQLITE3 1)
endif()
if(LWS_WITH_DISTRO_RECOMMENDED)
set(LWS_WITH_HTTP2 1) # selfcontained
set(LWS_WITH_LWSWS 1) # libuv
set(LWS_WITH_CGI 1) # selfcontained
set(LWS_WITH_HTTP_STREAM_COMPRESSION 1) # libz and brotli if avail
set(LWS_IPV6 1) # selfcontained
set(LWS_WITH_ZIP_FOPS 1) # libz
set(LWS_WITH_SOCKS5 1) # selfcontained
set(LWS_WITH_RANGES 1) # selfcontained
set(LWS_WITH_ACME 1) # selfcontained / tls
set(LWS_WITH_SYS_METRICS 1) # selfcontained
set(LWS_WITH_GLIB 1) # glib
set(LWS_WITH_LIBUV 1) # libuv
set(LWS_WITH_LIBEV 1) # libev
set(LWS_WITH_LIBEVENT 1) # libevent
set(LWS_WITH_EVLIB_PLUGINS 1) # event libraries created as plugins / individual packages
set(LWS_WITHOUT_EXTENSIONS 0) # libz
set(LWS_ROLE_DBUS 1) # dbus-related libs
set(LWS_WITH_FTS 1) # selfcontained
set(LWS_WITH_THREADPOOL 1) # pthreads
set(LWS_UNIX_SOCK 1) # selfcontained
set(LWS_WITH_HTTP_PROXY 1) # selfcontained
set(LWS_WITH_DISKCACHE 1) # selfcontained
set(LWS_WITH_LWSAC 1) # selfcontained
set(LWS_WITH_LEJP_CONF 1) # selfcontained
set(LWS_WITH_PLUGINS_BUILTIN 1) # selfcontained
set(LWS_ROLE_RAW_PROXY 1) # selfcontained
set(LWS_WITH_GENCRYPTO 1) # selfcontained / tls
set(LWS_WITH_CBOR 1) # selfcontained
set(LWS_WITH_COSE 1) # selfcontained
set(LWS_WITH_JOSE 1) # selfcontained
set(LWS_WITH_STRUCT_JSON 1) # selfcontained
set(LWS_WITH_STRUCT_SQLITE3 1) # sqlite3
set(LWS_WITH_SPAWN 1) # selfcontained
# libmount is problematic on Centos 8 / RHEL 8
# set(LWS_WITH_FSMOUNT 1)
set(LWS_ROLE_MQTT 1) # selfcontained
set(LWS_WITH_SECURE_STREAMS 1) # selfcontained
set(LWS_WITH_SECURE_STREAMS_PROXY_API 1) # selfcontained
set(LWS_WITH_DIR 1) # selfcontained
endif()
# LWS_WITH_EVENT_LIBS is set if any event lib selected
if (LWS_WITH_LIBEV OR
LWS_WITH_LIBUV OR
LWS_WITH_LIBEVENT OR
LWS_WITH_GLIB OR
LWS_WITH_SDEVENT OR
LWS_WITH_ULOOP)
set(LWS_WITH_EVENT_LIBS 1)
else()
unset(LWS_WITH_EVENT_LIBS)
endif()
if (LWS_WITH_SECURE_STREAMS_PROXY_API)
set(LWS_WITH_LWS_DSH 1)
set(LWS_WITH_UNIX_SOCK 1)
set(LWS_WITH_SYS_SMD 1)
set(LWS_WITH_SECURE_STREAMS 1)
endif()
if (NOT LWS_WITH_NETWORK)
set(LWS_ROLE_MQTT 0)
set(LWS_ROLE_H1 0)
set(LWS_ROLE_WS 0)
set(LWS_ROLE_RAW 0)
set(LWS_WITHOUT_EXTENSIONS 1)
set(LWS_WITHOUT_SERVER 1)
set(LWS_WITHOUT_CLIENT 1)
set(LWS_WITH_HTTP2 0)
set(LWS_WITH_SOCKS5 0)
set(LWS_UNIX_SOCK 0)
set(LWS_WITH_HTTP_PROXY 0)
set(LWS_WITH_PLUGINS 0)
set(LWS_WITH_LWSWS 0)
set(LWS_WITH_CGI 0)
set(LWS_ROLE_RAW_PROXY 0)
set(LWS_WITH_PEER_LIMITS 0)
set(LWS_WITH_HTTP_STREAM_COMPRESSION 0)
set(LWS_WITH_HTTP_BROTLI 0)
set(LWS_WITH_POLL 0)
set(LWS_ROLE_DBUS 0)
set(LWS_WITH_LWS_DSH 0)
set(LWS_WITH_THREADPOOL 0)
set(LWS_WITH_SYS_SMD 0)
set(LWS_WITH_LHP 0)
endif()
if (LWS_WITH_CGI)
set(LWS_WITH_SPAWN 1)
endif()
if (LWS_WITH_STRUCT_SQLITE3)
set(LWS_WITH_SQLITE3 1)
endif()
if (LWS_WITH_HTTP_BASIC_AUTH)
# WWW_AUTHENTICATE used by basic auth is an "uncommon header"
set(LWS_WITH_HTTP_UNCOMMON_HEADERS 1)
endif()
if (LWS_WITH_SECURE_STREAMS_AUTH_SIGV4)
set(LWS_WITH_GENCRYPTO 1)
endif()
if (LWS_WITH_HTTP_DIGEST_AUTH)
set(LWS_WITH_GENCRYPTO 1)
endif()
if (APPLE)
set(LWS_ROLE_DBUS 0)
endif()
if(NOT DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
endif()
if (LWS_PLAT_FREERTOS)
set(LWS_UNIX_SOCK 0)
endif()
if (LWS_PLAT_FREERTOS)
set(LWS_WITH_FTS 0)
endif()
if (LWS_WITH_HTTP2)
set(LWS_ROLE_H2 1)
endif()
if (LWS_WITH_CGI)
set(LWS_ROLE_CGI 1)
endif()
if (NOT LWS_ROLE_WS)
set(LWS_WITHOUT_EXTENSIONS 1)
endif()
unset(LWS_WITH_LIBUV_INTERNAL)
if (LWS_WITH_LWSWS)
message(STATUS "LWS_WITH_LWSWS --> Enabling LWS_WITH_PLUGINS and LWS_WITH_LIBUV")
set(LWS_WITH_PLUGINS 1)
set(LWS_WITH_LIBUV 1)
set(LWS_WITH_LIBUV_INTERNAL 1)
set(LWS_WITH_EVENT_LIBS 1) # implied by LIBUV_INTERNAL
set(LWS_WITH_ACCESS_LOG 1)
set(LWS_WITH_SYS_METRICS 1)
set(LWS_WITH_LEJP 1)
set(LWS_WITH_LEJP_CONF 1)
set(LWS_WITH_PEER_LIMITS 1)
set(LWS_ROLE_RAW_PROXY 1)
endif()
# sshd plugin
if (LWS_WITH_PLUGINS)
set(LWS_WITH_GENCRYPTO 1)
endif()
if (LWS_ROLE_RAW_PROXY)
set (LWS_WITH_CLIENT 1)
set (LWS_WITH_SERVER 1)
endif()
if (LWS_WITH_ACME)
set (LWS_WITH_CLIENT 1)
set (LWS_WITH_SERVER 1)
set (LWS_WITH_JOSE 1)
endif()
if (LWS_WITH_JOSE)
set(LWS_WITH_LEJP 1)
set(LWS_WITH_GENCRYPTO 1)
endif()
if (LWS_WITH_PLUGINS AND NOT LWS_WITH_LIBUV)
message(STATUS "LWS_WITH_PLUGINS --> Enabling LWS_WITH_LIBUV")
set(LWS_WITH_LIBUV 1)
set(LWS_WITH_EVENT_LIBS 1)
endif()
if (LWS_WITH_PLUGINS OR LWS_WITH_CGI)
# sshd plugin
set(LWS_WITH_GENCRYPTO 1)
endif()
if (LWS_PLAT_FREERTOS)
set(LWS_WITH_SHARED OFF)
if (LWS_WITH_SSL)
set(LWS_WITH_MBEDTLS ON)
endif()
# set(LWS_WITHOUT_CLIENT ON)
set(LWS_WITHOUT_TESTAPPS ON)
set(LWS_WITHOUT_EXTENSIONS ON)
set(LWS_WITH_PLUGINS OFF)
set(LWS_WITH_RANGES ON)
# this implies no pthreads in the lib
set(LWS_MAX_SMP 1)
set(LWS_HAVE_MALLOC 1)
set(LWS_HAVE_REALLOC 1)
set(LWS_HAVE_GETIFADDRS 1)
set(LWS_WITH_CUSTOM_HEADERS 0)
endif()
if (LWS_WITHOUT_TESTAPPS)
set(LWS_WITH_MINIMAL_EXAMPLES 0)
endif()
#if (LWS_WITH_ESP32)
# set(LWS_WITH_ZIP_FOPS 1)
#endif()
if (WIN32)
#set(LWS_MAX_SMP 1)
if (LWS_WITH_PLUGINS)
set(LWS_WITH_LIBUV_INTERNAL 1)
endif()
endif()
if (LWS_WITHOUT_SERVER)
set(LWS_WITH_LWSWS OFF)
endif()
if (LWS_WITH_LEJP_CONF)
set(LWS_WITH_DIR 1)
endif()
# confirm H1 relationships
if (NOT LWS_ROLE_H1 AND LWS_ROLE_H2)
message(FATAL_ERROR "H2 requires LWS_ROLE_H1")
endif()
if (NOT LWS_ROLE_H1 AND LWS_ROLE_WS)
message(FATAL_ERROR "WS requires LWS_ROLE_H1")
endif()
if (NOT LWS_ROLE_H1 AND LWS_ROLE_CGI)
message(FATAL_ERROR "CGI requires LWS_ROLE_H1")
endif()
# confirm HTTP relationships
if (NOT LWS_ROLE_H1 AND NOT LWS_ROLE_H2 AND LWS_WITH_HTTP_PROXY)
message(FATAL_ERROR "LWS_WITH_LWSWS requires LWS_ROLE_H1")
endif()
if (NOT LWS_ROLE_H1 AND NOT LWS_ROLE_H2 AND LWS_WITH_HTTP_PROXY)
message(FATAL_ERROR "LWS_WITH_HTTP_PROXY requires LWS_ROLE_H1")
endif()
if (NOT LWS_ROLE_H1 AND NOT LWS_ROLE_H2 AND LWS_WITH_RANGES)
message(FATAL_ERROR "LWS_WITH_RANGES requires LWS_ROLE_H1")
endif()
if (NOT LWS_ROLE_H1 AND NOT LWS_ROLE_H2 AND LWS_WITH_ACCESS_LOG)
message(FATAL_ERROR "LWS_WITH_ACCESS_LOG requires LWS_ROLE_H1")
endif()
if (LWS_WITH_HTTP_PROXY AND (LWS_WITHOUT_CLIENT OR LWS_WITHOUT_SERVER))
message("You have to enable both client and server for http proxy")
set(LWS_WITH_HTTP_PROXY 0)
endif()
if (NOT LWS_WITHOUT_EXTENSIONS OR LWS_WITH_ZIP_FOPS)
set(LWS_WITH_ZLIB 1)
endif()
if (LWS_WITH_SECURE_STREAMS)
set(LWS_WITH_SECURE_STREAMS_SYS_AUTH_API_AMAZON_COM 1)
endif()
if (NOT (LWS_WITH_STATIC OR LWS_WITH_SHARED))
message(FATAL_ERROR "Makes no sense to compile with neither static nor shared libraries.")
endif()
if (LWS_WITHOUT_DAEMONIZE OR WIN32)
set(LWS_NO_DAEMONIZE 1)
endif()
if (LWS_IPV6)
set(LWS_WITH_IPV6 1)
endif()
if (LWS_UNIX_SOCK)
set(LWS_WITH_UNIX_SOCK 1)
endif()
if (NOT LWS_MAX_SMP)
set(LWS_MAX_SMP 1)
endif()
if ("${LWS_MAX_SMP}" STREQUAL "")
set(LWS_MAX_SMP 1)
endif()
set(LWS_WITH_CLIENT 1)
if (LWS_WITHOUT_CLIENT)
set(LWS_WITH_CLIENT 0)
set(LWS_WITH_SECURE_STREAMS 0)
set(LWS_WITH_SECURE_STREAMS_PROXY_API 0)
set(LWS_WITH_LHP 0)
endif()
set(LWS_WITH_SERVER 1)
if (LWS_WITHOUT_SERVER)
set(LWS_WITH_SERVER)
endif()
if (LWS_WITH_SERVER)
else()
set(LWS_WITH_CGI 0)
set(LWS_ROLE_CGI 0)
endif()
if (LWS_WITH_UPNG)
set(LWS_WITH_GZINFLATE 1)
endif()
if (LWS_WITH_OTA)
set(LWS_WITH_JOSE 1)
set(LWS_WITH_GENCRYPTO 1)
set(LWS_WITH_GZINFATE 1)
endif()
if (LWS_WITH_LHP)
set(LWS_WITH_CLIENT 1)
set(LWS_WITH_SECURE_STREAMS 1)
endif()
# using any abstract protocol enables LWS_WITH_ABSTRACT
#if (LWS_WITH_SMTP)
# set(LWS_WITH_ABSTRACT 1)
#endif()
if (NOT LWS_WITH_EVLIB_PLUGINS AND (LWS_WITH_LIBEV AND LWS_WITH_LIBEVENT))
message(FATAL_ERROR "Sorry libev and libevent conflict with each others' namespace, you can only have one or the other")
endif()
if (LWS_SSL_SERVER_WITH_ECDH_CERT)
set(LWS_SSL_SERVER_WITH_ECDH_CERT 1)
endif()
# LWS_OPENSSL_SUPPORT deprecated... use LWS_WITH_TLS
if (LWS_WITH_SSL OR LWS_WITH_MBEDTLS)
set(LWS_OPENSSL_SUPPORT 1)
set(LWS_WITH_TLS 1)
endif()
if (NOT LWS_WITH_SSL)
set(LWS_WITHOUT_BUILTIN_SHA1 OFF)
endif()
# protocol plugins dont make any sense either
if (LWS_WITH_PLUGINS AND NOT LWS_WITH_SHARED)
message("Deselecting PLUGINS since building static")
set(LWS_WITH_PLUGINS 0)
endif()
if (LWS_WITH_TLS_SESSIONS)
if (NOT LWS_WITH_NETWORK OR NOT LWS_WITH_CLIENT)
message("TLS_SESSIONS support requires client, disabling")
set(LWS_WITH_TLS_SESSIONS OFF)
endif()
endif()
# if we're only building static, we don't want event lib plugins
#
if (LWS_WITH_EVLIB_PLUGINS AND NOT LWS_WITH_SHARED)
message("Deselecting EVLIB_PLUGINS since building static")
set(LWS_WITH_EVLIB_PLUGINS 0)
endif()
if (LWS_WITH_PLUGINS OR (LWS_WITH_EVLIB_PLUGINS AND LWS_WITH_EVENT_LIBS))
set(LWS_WITH_PLUGINS_API 1)
endif()
if (WIN32 AND NOT LWS_EXT_PTHREAD_LIBRARIES)
set(LWS_MAX_SMP 1)
message("SMD requires pthreads")
set(LWS_WITH_SYS_SMD 0)
endif()