aboutsummaryrefslogtreecommitdiff
path: root/src/transport/ws
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-11-05 13:54:40 -0800
committerGarrett D'Amore <garrett@damore.org>2018-11-05 16:20:23 -0800
commit77984b14a65c0a7387c97f3d36f947dd17358744 (patch)
treed95ad88933c9fe8853cbc74fe8dc1492d60ad443 /src/transport/ws
parentdb92342b43d429b8b07244cc003a8589a1b1c542 (diff)
downloadnng-77984b14a65c0a7387c97f3d36f947dd17358744.tar.gz
nng-77984b14a65c0a7387c97f3d36f947dd17358744.tar.bz2
nng-77984b14a65c0a7387c97f3d36f947dd17358744.zip
fixes #577 target library dependencies should be public
This is a significant refactor of the library configuration. We use the modern package configuration helper, with a template script that also does the find_package dance for any of our dependencies. We also have restructured the code so that most protocols and transports have their configuration isolated to their own CMakeLists file, reducing the size of the global CMakeLists file.
Diffstat (limited to 'src/transport/ws')
-rw-r--r--src/transport/ws/CMakeLists.txt30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/transport/ws/CMakeLists.txt b/src/transport/ws/CMakeLists.txt
index 71e2aefa..8104d83c 100644
--- a/src/transport/ws/CMakeLists.txt
+++ b/src/transport/ws/CMakeLists.txt
@@ -9,11 +9,33 @@
#
# WebSocket transport
+option (NNG_TRANSPORT_WS "Enable WebSocket transport." ON)
+mark_as_advanced(NNG_TRANSPORT_WS)
+
+CMAKE_DEPENDENT_OPTION(NNG_TRANSPORT_WSS "Enable WSS transport" ON
+ "NNG_ENABLE_TLS" OFF)
+mark_as_advanced(NNG_TRANSPORT_WSS)
+
+set(_DEFS)
if (NNG_TRANSPORT_WS)
- set(WS_SOURCES transport/ws/websocket.c transport/ws/websocket.h)
- set(WS_HEADERS transport/ws/websocket.h)
+ list(APPEND _DEFS -DNNG_TRANSPORT_WS)
+endif()
+if (NNG_TRANSPORT_WSS)
+ list(APPEND _DEFS -DNNG_TRANSPORT_WSS)
endif()
-set(NNG_SOURCES ${NNG_SOURCES} ${WS_SOURCES} PARENT_SCOPE)
-set(NNG_HEADERS ${NNG_HEADERS} ${WS_HEADERS} PARENT_SCOPE)
+if (NNG_TRANSPORT_WS OR NNG_TRANSPORT_WSS)
+
+ # Make sure things we *MUST* have are enabled.
+ set(NNG_SUPP_WEBSOCKET ON PARENT_SCOPE)
+ set(NNG_SUPP_HTTP ON PARENT_SCOPE)
+ set(NNG_SUPP_BASE64 ON PARENT_SCOPE)
+ set(NNG_SUPP_SHA1 ON PARENT_SCOPE)
+
+ set(_SRCS transport/ws/websocket.c transport/ws/websocket.h)
+ set(_HDRS transport/ws/websocket.h)
+ set(NNG_DEFS ${NNG_DEFS} ${_DEFS} PARENT_SCOPE)
+ set(NNG_SRCS ${NNG_SRCS} ${_SRCS} PARENT_SCOPE)
+ set(NNG_HDRS ${NNG_HDRS} ${_HDRS} PARENT_SCOPE)
+endif()