Problem: no check if noexcept is supported by compiler

Solution: add compile check
This commit is contained in:
Simon Giesecke 2018-05-30 22:03:19 +02:00
parent 93194e7c53
commit 0dce223341
3 changed files with 21 additions and 0 deletions

View File

@ -415,6 +415,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "SunOS" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD")
endif () endif ()
endif () endif ()
zmq_check_noexcept ()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
if (NOT CMAKE_CROSSCOMPILING AND NOT MSVC) if (NOT CMAKE_CROSSCOMPILING AND NOT MSVC)

View File

@ -293,3 +293,21 @@ int main (int argc, char *argv [])
" "
ZMQ_HAVE_GETRANDOM) ZMQ_HAVE_GETRANDOM)
endmacro() 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()

View File

@ -19,6 +19,8 @@
#cmakedefine HAVE_MKDTEMP #cmakedefine HAVE_MKDTEMP
#cmakedefine ZMQ_HAVE_UIO #cmakedefine ZMQ_HAVE_UIO
#cmakedefine ZMQ_HAVE_NOEXCEPT
#cmakedefine ZMQ_HAVE_EVENTFD #cmakedefine ZMQ_HAVE_EVENTFD
#cmakedefine ZMQ_HAVE_EVENTFD_CLOEXEC #cmakedefine ZMQ_HAVE_EVENTFD_CLOEXEC
#cmakedefine ZMQ_HAVE_IFADDRS #cmakedefine ZMQ_HAVE_IFADDRS