• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# libwebsockets - small server side websockets and web server implementation
3#
4# Copyright (C) 2010 - 2020 Andy Green <andy@warmcat.com>
5#
6# Permission is hereby granted, free of charge, to any person obtaining a copy
7# of this software and associated documentation files (the "Software"), to
8# deal in the Software without restriction, including without limitation the
9# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10# sell copies of the Software, and to permit persons to whom the Software is
11# furnished to do so, subject to the following conditions:
12#
13# The above copyright notice and this permission notice shall be included in
14# all copies or substantial portions of the Software.
15#
16# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22# IN THE SOFTWARE.
23#
24# The strategy is to only export to PARENT_SCOPE
25#
26#  - changes to LIB_LIST
27#  - changes to SOURCES
28#  - includes via include_directories
29#
30# and keep everything else private
31
32include_directories(.)
33
34list(APPEND SOURCES
35	misc/base64-decode.c
36	misc/prng.c
37	misc/lws-ring.c)
38
39if (LWS_WITH_NETWORK)
40	list(APPEND SOURCES
41		misc/cache-ttl/lws-cache-ttl.c
42		misc/cache-ttl/heap.c
43		)
44
45	if (LWS_WITH_CACHE_NSCOOKIEJAR)
46		list(APPEND SOURCES
47			misc/cache-ttl/file.c)
48	endif()
49
50endif()
51
52if (LWS_WITH_FTS)
53	list(APPEND SOURCES
54		misc/fts/trie.c
55		misc/fts/trie-fd.c)
56endif()
57
58# this is an older, standalone hashed disk cache
59# implementation unrelated to lws-cache-ttl
60if (LWS_WITH_DISKCACHE)
61	list(APPEND SOURCES
62		misc/diskcache.c)
63endif()
64
65if (LWS_WITH_STRUCT_JSON)
66	list(APPEND SOURCES
67		misc/lws-struct-lejp.c)
68endif()
69
70if (LWS_WITH_STRUCT_SQLITE3)
71	list(APPEND SOURCES
72		misc/lws-struct-sqlite.c)
73endif()
74
75if (LWS_WITH_FSMOUNT AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
76	list(APPEND SOURCES misc/fsmount.c)
77endif()
78
79if (LWS_WITH_DIR)
80	list(APPEND SOURCES misc/dir.c)
81endif()
82
83if (LWS_WITH_THREADPOOL AND LWS_HAVE_PTHREAD_H)
84	list(APPEND SOURCES misc/threadpool/threadpool.c)
85endif()
86
87if (LWS_WITH_PEER_LIMITS)
88	list(APPEND SOURCES
89		misc/peer-limits.c)
90endif()
91
92if (LWS_WITH_LWSAC)
93	list(APPEND SOURCES
94		misc/lwsac/lwsac.c)
95	if (NOT LWS_PLAT_FREERTOS)
96		list(APPEND SOURCES
97			misc/lwsac/cached-file.c)
98	endif()
99	if (LWS_WITH_SECURE_STREAMS_CPP)
100		list(APPEND SOURCES misc/lwsac/lwsac.cxx)
101	endif()
102endif()
103
104if (NOT LWS_WITHOUT_BUILTIN_SHA1)
105	list(APPEND SOURCES
106		misc/sha-1.c)
107endif()
108
109if (LWS_WITH_LEJP)
110	list(APPEND SOURCES
111		misc/lejp.c)
112endif()
113if (LWS_WITH_CBOR)
114	list(APPEND SOURCES
115		misc/lecp.c
116		misc/ieeehalfprecision.c)
117endif()
118
119
120if (UNIX)
121	if (NOT LWS_HAVE_GETIFADDRS)
122		list(APPEND HDR_PRIVATE misc/getifaddrs.h)
123		list(APPEND SOURCES misc/getifaddrs.c)
124	endif()
125endif()
126
127if (NOT WIN32 AND NOT LWS_WITHOUT_DAEMONIZE)
128	list(APPEND SOURCES
129		misc/daemonize.c)
130endif()
131
132#
133# Keep explicit parent scope exports at end
134#
135
136exports_to_parent_scope()
137