summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2020-11-01 22:05:35 -0800
committerGarrett D'Amore <garrett@damore.org>2020-11-08 17:50:24 -0800
commitfc6882305f0b5e06e58a0a25740f422d133015b5 (patch)
tree714b1fa4656253c8731a8f3f0861c24715440f95 /CMakeLists.txt
parent4bf06d03f6ebead7f4e0603a2da3b1b891887878 (diff)
downloadnng-fc6882305f0b5e06e58a0a25740f422d133015b5.tar.gz
nng-fc6882305f0b5e06e58a0a25740f422d133015b5.tar.bz2
nng-fc6882305f0b5e06e58a0a25740f422d133015b5.zip
fixes #1041 Abstract socket address for IPC
fixes #1326 Linux IPC could use fchmod fixes #1327 getsockname on ipc may not work This introduces an abstract:// style transport, which on Linux results in using the abstract socket with the given name (not including the leading NULL byte). A new NNG_AF_ABSTRACT is provided. Auto bind abstract sockets are also supported. While here we have inlined the aios for the POSIX ipc pipe objects, eliminating at least one set of failure paths, and have also performed various other cleanups. A unix:// alias is available on POSIX systems, which acts just like ipc:// (and is fact just an alias). This is supplied so that in the future we can add support for AF_UNIX on Windows. We've also absorbed the ipcperms test into the new ipc_test suite. Finally we are now enforcing that IPC path names on Windows are not over the maximum size, rather than just silently truncating them.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 77233435..d46c42b9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -193,6 +193,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux")
add_definitions(-DNNG_PLATFORM_POSIX)
add_definitions(-DNNG_PLATFORM_LINUX)
add_definitions(-DNNG_USE_EVENTFD)
+ add_definitions(-DNNG_HAVE_ABSTRACT_SOCKETS)
# Windows subsystem for Linux -- smells like Linux, but it has
# some differences (SO_REUSEADDR for one).
if (CMAKE_SYSTEM_VERSION MATCHES "Microsoft")
@@ -385,6 +386,20 @@ macro(nng_test NAME)
endif ()
endmacro()
+macro(nng_test_if COND NAME)
+ if (${COND} AND NNG_TESTS)
+ add_executable(${NAME} ${NAME}.c ${ARGN})
+ target_link_libraries(${NAME} ${PROJECT_NAME}_testlib)
+ target_include_directories(${NAME} PRIVATE
+ ${PROJECT_SOURCE_DIR}/tests
+ ${PROJECT_SOURCE_DIR}/src
+ ${PROJECT_SOURCE_DIR}/include)
+ add_test(NAME ${PROJECT_NAME}.${NAME} COMMAND ${NAME} -t)
+ set_tests_properties(${PROJECT_NAME}.${NAME} PROPERTIES TIMEOUT 180)
+ endif ()
+endmacro()
+
+
function(nng_sources_testlib)
if (NNG_TESTS)
foreach (f ${ARGN})