summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2020-11-15 17:47:54 -0800
committerGarrett D'Amore <garrett@damore.org>2020-11-15 17:47:54 -0800
commit249932f3a208260f6b9c99d778b22d51cfabe87b (patch)
tree4fd4826127e9c225d5232c39d4ae1db89b539689 /CMakeLists.txt
parenteb328da56c3fc7167b536dcb206df0abb0f4a9b9 (diff)
downloadnng-249932f3a208260f6b9c99d778b22d51cfabe87b.tar.gz
nng-249932f3a208260f6b9c99d778b22d51cfabe87b.tar.bz2
nng-249932f3a208260f6b9c99d778b22d51cfabe87b.zip
fixes #1071 tran_chkopt can be cleaned up
This is a sweeping cleanup of the transport logic around options, and also harmonizes the names used when setting or getting options. Additionally, legacy methods are now moved into a separate file and can be elided via CMake or a preprocessor define. Fundamentally, the ability to set to transport options via the socket is deprecated; there are numerous problems with this and my earlier approaches to deal with this have been somewhat misguided. Further these approaches will not work with future protocol work that is planned (were some options need to be negotiated with peers at the time of connection establishment.) Documentation has been updated to reflect this. The test suites still make rather broad use of the older APIs, and will be converted later.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt22
1 files changed, 18 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a2c10644..e55470b4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -78,18 +78,17 @@ endif ()
# cross-compile situation. Cross-compiling users who still want to
# build these must enable them explicitly. Some of these switches
# must be enabled rather early as we use their values later.
-option(NNG_TESTS "Build and run tests" ${NNG_NATIVE_BUILD})
-option(NNG_TOOLS "Build extra tools" ${NNG_NATIVE_BUILD})
+option(NNG_TESTS "Build and run tests." ${NNG_NATIVE_BUILD})
+option(NNG_TOOLS "Build extra tools." ${NNG_NATIVE_BUILD})
option(NNG_ENABLE_NNGCAT "Enable building nngcat utility." ${NNG_TOOLS})
option(NNG_ENABLE_COVERAGE "Enable coverage reporting." OFF)
-
# Enable access to private APIs for our own use.
add_definitions(-DNNG_PRIVATE)
if (NOT (BUILD_SHARED_LIBS))
set(NNG_STATIC_LIB ON)
- message(STATUS "Building static libs")
+ message(STATUS "Building static libs.")
endif ()
# These are library targets. The "nng" library is the main public library.
@@ -109,6 +108,21 @@ target_compile_definitions(nng_testing PUBLIC NNG_STATIC_LIB NNG_TEST_LIB NNG_PR
add_library(nng_private INTERFACE)
target_compile_definitions(nng_private INTERFACE NNG_PRIVATE)
+# Eliding deprecated functionality can be used to build a slimmed down
+# version of the library, or alternatively to test for application
+# preparedness for expected feature removals (in the next major release.)
+# Applications can also set the NNG_ELIDE_DEPRECATED preprocessor symbol
+# before including <nng/nng.h> -- this will prevent declarations from
+# being exposed to applications, but it will not affect their ABI
+# availability for existing compiled applications.
+# Note: Currently this breaks the test suite, so we only do it
+# for the public library.
+option(NNG_ELIDE_DEPRECATED "Elide deprecated functionality." OFF)
+if (NNG_ELIDE_DEPRECATED)
+ target_compile_definitions(nng, NNG_ELIDE_DEPRECATED)
+endif()
+
+
# We can use rlimit to configure the stack size for systems
# that have too small defaults. This is not used for Windows,
# which can grow thread stacks sensibly. (Note that NNG can get