aboutsummaryrefslogtreecommitdiff
path: root/src/protocol/pubsub0
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocol/pubsub0')
-rw-r--r--src/protocol/pubsub0/CMakeLists.txt24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/protocol/pubsub0/CMakeLists.txt b/src/protocol/pubsub0/CMakeLists.txt
index 49ec8913..29f64049 100644
--- a/src/protocol/pubsub0/CMakeLists.txt
+++ b/src/protocol/pubsub0/CMakeLists.txt
@@ -9,16 +9,28 @@
#
# Pub/Sub protocol
+option (NNG_PROTO_PUB0 "Enable PUBv0 protocol." ON)
+mark_as_advanced(NNG_PROTO_PUB0)
+
+option (NNG_PROTO_SUB0 "Enable SUBv0 protocol." ON)
+mark_as_advanced(NNG_PROTO_SUB0)
+
+set(_DEFS)
+set(_SRCS)
+set(_HDRS)
if (NNG_PROTO_PUB0)
- set(PUB0_SOURCES protocol/pubsub0/pub.c protocol/pubsub0/pub.h)
- set(PUB0_HEADERS protocol/pubsub0/pub.h)
+ list(APPEND _DEFS -DNNG_HAVE_PUB0)
+ list(APPEND _SRCS protocol/pubsub0/pub.c protocol/pubsub0/pub.h)
+ list(APPEND _HDRS protocol/pubsub0/pub.h)
endif()
if (NNG_PROTO_SUB0)
- set(SUB0_SOURCES protocol/pubsub0/sub.c protocol/pubsub0/sub.h)
- set(SUB0_HEADERS protocol/pubsub0/sub.h)
+ list(APPEND _DEFS -DNNG_HAVE_SUB0)
+ list(APPEND _SRCS protocol/pubsub0/sub.c protocol/pubsub0/sub.h)
+ list(APPEND _HDRS protocol/pubsub0/sub.h)
endif()
-set(NNG_SOURCES ${NNG_SOURCES} ${PUB0_SOURCES} ${SUB0_SOURCES} PARENT_SCOPE)
-set(NNG_HEADERS ${NNG_HEADERS} ${PUB0_HEADERS} ${SUB0_HEADERS} PARENT_SCOPE)
+set(NNG_DEFS ${NNG_DEFS} ${_DEFS} PARENT_SCOPE)
+set(NNG_SRCS ${NNG_SRCS} ${_SRCS} PARENT_SCOPE)
+set(NNG_HDRS ${NNG_HDRS} ${_HDRS} PARENT_SCOPE)