From 7e09306cb369f4c345850627f3969be153eaa3cf Mon Sep 17 00:00:00 2001 From: Matt Bolger Date: Fri, 21 Aug 2015 13:45:59 +1000 Subject: [PATCH] -Set signaler_port to 0 which allows the OS to find a free port, rather than crashing if 5905 is in use (https://github.com/zeromq/libzmq/issues/1542) -Added config.hpp to the source list so it shows up in generated projects -Remove CMAKE_BUILD_TYPE setting for generators that don't use it --- CMakeLists.txt | 7 +++++-- src/config.hpp | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5dd1e3be..f1d94fbb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -326,7 +326,9 @@ endif() #----------------------------------------------------------------------------- # default to Release build -if(NOT CMAKE_BUILD_TYPE) +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + # CMAKE_BUILD_TYPE is not used for multi-configuration generators like Visual Studio/XCode + # which instead use CMAKE_CONFIGURATION_TYPES set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) @@ -436,7 +438,8 @@ set(cxx-sources xsub.cpp zmq.cpp zmq_utils.cpp - decoder_allocators.cpp) + decoder_allocators.cpp + config.hpp) set(rc-sources version.rc) diff --git a/src/config.hpp b/src/config.hpp index b483c469..de5e44e3 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -89,7 +89,11 @@ namespace zmq // On some OSes the signaler has to be emulated using a TCP // connection. In such cases following port is used. - signaler_port = 5905 + // If 0, it lets the OS choose a free port without requiring use of a + // global mutex. The original implementation of a Windows signaler + // socket used port 5905 instead of letting the OS choose a free port. + // https://github.com/zeromq/libzmq/issues/1542 + signaler_port = 0 }; }