• 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
25include_directories(.)
26
27if (LWS_WITH_CLIENT)
28	list(APPEND SOURCES
29			secure-streams/secure-streams.c
30			secure-streams/policy-common.c
31			secure-streams/system/captive-portal-detect/captive-portal-detect.c
32			secure-streams/protocols/ss-raw.c
33		)
34		if (NOT LWS_WITH_SECURE_STREAMS_STATIC_POLICY_ONLY)
35			list(APPEND SOURCES
36				secure-streams/policy-json.c
37				secure-streams/system/fetch-policy/fetch-policy.c
38			)
39		endif()
40		if (LWS_ROLE_H1)
41			list(APPEND SOURCES
42				secure-streams/protocols/ss-h1.c
43			)
44		endif()
45		if (LWS_ROLE_H2)
46			list(APPEND SOURCES
47				secure-streams/protocols/ss-h2.c
48			)
49		endif()
50		if (LWS_ROLE_WS)
51			list(APPEND SOURCES
52				secure-streams/protocols/ss-ws.c
53			)
54		endif()
55		if (LWS_ROLE_MQTT)
56			list(APPEND SOURCES
57				secure-streams/protocols/ss-mqtt.c
58			)
59		endif()
60
61		if (LWS_WITH_SECURE_STREAMS_PROXY_API)
62			list(APPEND SOURCES
63				secure-streams/secure-streams-serialize.c
64				secure-streams/secure-streams-client.c
65			)
66		endif()
67
68		if (LWS_WITH_SECURE_STREAMS_PROXY_API)
69			list(APPEND SOURCES
70				secure-streams/secure-streams-process.c
71			)
72		endif()
73
74		if (LWS_WITH_SECURE_STREAMS_SYS_AUTH_API_AMAZON_COM AND
75		    LWS_WITH_SYS_STATE)
76			list(APPEND SOURCES
77				secure-streams/system/auth-api.amazon.com/auth.c
78			)
79		endif()
80
81		if (LWS_WITH_SECURE_STREAMS_AUTH_SIGV4)
82			list(APPEND SOURCES
83				secure-streams/system/auth-sigv4/sign.c
84			)
85		endif()
86
87
88		if (LWS_WITH_SECURE_STREAMS_CPP)
89			list(APPEND SOURCES secure-streams/cpp/lss.cxx)
90
91			if (LWS_ROLE_H1 OR LWS_ROLE_H2)
92				list(APPEND SOURCES secure-streams/cpp/lssFile.cxx)
93			endif()
94
95			if (LWS_ROLE_WS)
96				list(APPEND SOURCES secure-streams/cpp/lssMsg.cxx)
97			endif()
98		endif()
99
100	#
101	# Helper function for adding a secure stream plugin
102	#
103	macro(create_ss_plugin NAME S2 S3 S4 S5 S6)
104
105		set(SSP_SRCS)
106		set(SSP_PUBLIC_HDR)
107		set(SSP_HDR)
108
109		if ("${S2}" STREQUAL "")
110		else()
111			list(APPEND SSP_SRCS plugins/${NAME}/${S2})
112		endif()
113		if ("${S3}" STREQUAL "")
114		else()
115			list(APPEND SSP_SRCS plugins/${NAME}/${S3})
116		endif()
117		if ("${S4}" STREQUAL "")
118		else()
119			list(APPEND SSP_SRCS plugins/${NAME}/${S4})
120		endif()
121		if ("${S5}" STREQUAL "")
122		else()
123			list(APPEND SSP_SRCS plugins/${NAME}/${S5})
124		endif()
125		if ("${S6}" STREQUAL "")
126		else()
127			list(APPEND SSP_SRCS plugins/${NAME}/${S6})
128		endif()
129
130		source_group("Headers Private"  FILES ${SSP_HDR})
131		source_group("Sources"		FILES ${SSP_SRCS})
132
133		add_library( ${NAME} STATIC
134			     ${SSP_HDR} ${SSP_PUBLIC_HDR} ${SSP_SRCS} )
135
136		target_include_directories(${NAME} PRIVATE "${LWS_LIB_INCLUDES}" ${LWS_LIB_BUILD_INC_PATHS})
137
138		if (NOT LWS_PLAT_FREERTOS)
139	                add_dependencies(${NAME} websockets_shared)
140		endif()
141		list(APPEND SS_PLUGINS_LIST ${NAME})
142	endmacro()
143
144	#	create_ss_plugin(ssp-h1url "h1url.c" "" "" "" "")
145endif()
146
147#
148# Keep explicit parent scope exports at end
149#
150
151exports_to_parent_scope()
152