forked from warmcat/libwebsockets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists-implied-options.txt
381 lines (322 loc) · 8.91 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
#
# libwebsockets - small server side websockets and web server implementation
#
# Copyright (C) 2010 - 2020 Andy Green <[email protected]>
#
# 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)
else()
set(LWS_WITH_ESP32_HELPER OFF)
endif()
if (LWS_WITH_ESP32)
set(LWS_PLAT_FREERTOS 1)
endif()
if (LWS_PLAT_FREERTOS OR LWS_PLAT_OPTEE)
set(LWS_WITH_UDP 0)
endif()
if (LWS_PLAT_FREERTOS)
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)
set(LWS_WITH_LWSWS 1)
set(LWS_WITH_CGI 1)
set(LWS_IPV6 1)
set(LWS_WITH_ZIP_FOPS 1)
set(LWS_WITH_SOCKS5 1)
set(LWS_WITH_RANGES 1)
set(LWS_WITH_ACME 1)
set(LWS_WITH_SERVER_STATUS 1)
set(LWS_WITH_GLIB 1)
set(LWS_WITH_LIBUV 1)
set(LWS_WITH_LIBEV 1)
# libev + libevent cannot coexist at build-time
set(LWS_WITH_LIBEVENT 0)
set(LWS_WITHOUT_EXTENSIONS 0)
set(LWS_ROLE_DBUS 1)
set(LWS_WITH_FTS 1)
set(LWS_WITH_THREADPOOL 1)
set(LWS_UNIX_SOCK 1)
set(LWS_WITH_HTTP_PROXY 1)
set(LWS_WITH_DISKCACHE 1)
set(LWS_WITH_LWSAC 1)
set(LWS_WITH_LEJP_CONF 1)
set(LWS_WITH_PLUGINS 1)
set(LWS_ROLE_RAW_PROXY 1)
set(LWS_WITH_GENCRYPTO 1)
set(LWS_WITH_JOSE 1)
set(LWS_WITH_STRUCT_JSON 1)
set(LWS_WITH_STRUCT_SQLITE3 1)
set(LWS_WITH_SPAWN 1)
# libmount is problematic on Centos 8 / RHEL 8
# set(LWS_WITH_FSMOUNT 1)
set(LWS_ROLE_MQTT 1)
set(LWS_WITH_SECURE_STREAMS 1)
set(LWS_WITH_SECURE_STREAMS_PROXY_API 1)
set(LWS_WITH_DIR 1)
endif()
if (LWS_WITH_SECURE_STREAMS_PROXY_API)
set(LWS_WITH_LWS_DSH 1)
set(LWS_WITH_UNIX_SOCK 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_GENERIC_SESSIONS 0)
set(LWS_WITH_HTTP_STREAM_COMPRESSION 0)
set(LWS_WITH_HTTP_BROTLI 0)
set(LWS_WITH_POLL 0)
set(LWS_WITH_SEQUENCER 0)
set(LWS_ROLE_DBUS 0)
set(LWS_WITH_LWS_DSH 0)
set(LWS_WITH_THREADPOOL 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 (APPLE)
set(LWS_ROLE_DBUS 0)
endif()
if(NOT DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
endif()
# microsoft... that's why you can't have nice things
if (WIN32 OR LWS_PLAT_FREERTOS)
set(LWS_UNIX_SOCK 0)
endif()
if (LWS_PLAT_FREERTOS)
set(LWS_WITH_LWSAC 0)
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()
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_ACCESS_LOG 1)
set(LWS_WITH_SERVER_STATUS 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)
endif()
if (LWS_WITH_PLUGINS OR LWS_WITH_CGI)
# sshd plugin
set(LWS_WITH_GENCRYPTO 1)
endif()
if (LWS_WITH_GENERIC_SESSIONS)
set(LWS_WITH_SQLITE3 1)
# set(LWS_WITH_SMTP 1)
set(LWS_WITH_STRUCT_SQLITE3 1)
endif()
if (LWS_PLAT_FREERTOS)
set(LWS_WITH_SHARED OFF)
set(LWS_WITH_MBEDTLS ON)
# 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_WITH_ESP32)
# set(LWS_WITH_ZIP_FOPS 1)
#endif()
if (WIN32)
set(LWS_MAX_SMP 1)
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_WITH_LIBEV)
set(LWS_WITH_LIBEV 1)
endif()
if (LWS_WITH_LIBUV)
set(LWS_WITH_LIBUV 1)
endif()
if (LWS_WITH_LIBEVENT)
set(LWS_WITH_LIBEVENT 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)
endif()
set(LWS_WITH_SERVER 1)
if (LWS_WITHOUT_SERVER)
set(LWS_WITH_SERVER)
endif()
# using any abstract protocol enables LWS_WITH_ABSTRACT
#if (LWS_WITH_SMTP)
# set(LWS_WITH_ABSTRACT 1)
#endif()
if (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 PARENT_SCOPE)
endif()