diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c754976..082bce5e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -415,6 +415,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "SunOS" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD") endif () endif () +zmq_check_noexcept () #----------------------------------------------------------------------------- if (NOT CMAKE_CROSSCOMPILING AND NOT MSVC) diff --git a/builds/cmake/Modules/ZMQSourceRunChecks.cmake b/builds/cmake/Modules/ZMQSourceRunChecks.cmake index 78cedbea..47653a6d 100644 --- a/builds/cmake/Modules/ZMQSourceRunChecks.cmake +++ b/builds/cmake/Modules/ZMQSourceRunChecks.cmake @@ -293,3 +293,21 @@ int main (int argc, char *argv []) " ZMQ_HAVE_GETRANDOM) endmacro() + +macro(zmq_check_noexcept) + message(STATUS "Checking whether noexcept is supported") + check_cxx_source_compiles( +" +struct X +{ + X(int i) noexcept {} +}; + +int main(int argc, char *argv []) +{ + X x(5); + return 0; +} +" + ZMQ_HAVE_NOEXCEPT) +endmacro() diff --git a/builds/cmake/platform.hpp.in b/builds/cmake/platform.hpp.in index 8c8e6cf2..4a910423 100644 --- a/builds/cmake/platform.hpp.in +++ b/builds/cmake/platform.hpp.in @@ -19,6 +19,8 @@ #cmakedefine HAVE_MKDTEMP #cmakedefine ZMQ_HAVE_UIO +#cmakedefine ZMQ_HAVE_NOEXCEPT + #cmakedefine ZMQ_HAVE_EVENTFD #cmakedefine ZMQ_HAVE_EVENTFD_CLOEXEC #cmakedefine ZMQ_HAVE_IFADDRS