0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-26 23:01:04 +08:00

Problem: cmake run is very slow with MSVC

Solution: skip tests than can never succeed with MSVC
This commit is contained in:
Simon Giesecke 2018-05-23 16:47:13 +02:00
parent 9df851225a
commit 06e0c0776d

View File

@ -103,6 +103,7 @@ set (POLLER "" CACHE STRING "Choose polling system for I/O threads. valid values
include (CheckFunctionExists)
include (CheckTypeSize)
if (NOT MSVC)
if (POLLER STREQUAL "")
set (CMAKE_REQUIRED_INCLUDES sys/event.h)
check_function_exists (kqueue HAVE_KQUEUE)
@ -151,6 +152,7 @@ if (POLLER STREQUAL "")
set (POLLER "poll")
endif ()
endif ()
endif()
if (POLLER STREQUAL "")
if (WIN32)
@ -213,18 +215,19 @@ include (CMakeDependentOption)
include (CheckCXXSymbolExists)
include (CheckSymbolExists)
check_include_files (ifaddrs.h ZMQ_HAVE_IFADDRS)
check_include_files (windows.h ZMQ_HAVE_WINDOWS)
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND CMAKE_SYSTEM_VERSION STREQUAL "10.0")
SET(ZMQ_HAVE_WINDOWS_UWP ON)
ADD_DEFINITIONS(-D_WIN32_WINNT=_WIN32_WINNT_WIN10)
endif()
if (NOT MSVC)
check_include_files (ifaddrs.h ZMQ_HAVE_IFADDRS)
check_include_files (sys/uio.h ZMQ_HAVE_UIO)
check_include_files (sys/eventfd.h ZMQ_HAVE_EVENTFD)
if (ZMQ_HAVE_EVENTFD AND NOT CMAKE_CROSSCOMPILING)
zmq_check_efd_cloexec ()
endif ()
endif()
if (ZMQ_HAVE_WINDOWS)
# Cannot use check_library_exists because the symbol is always declared as char(*)(void)
@ -264,6 +267,7 @@ if (WIN32 AND NOT CYGWIN)
endif ()
endif ()
if (NOT MSVC)
set (CMAKE_REQUIRED_LIBRARIES rt)
check_function_exists (clock_gettime HAVE_CLOCK_GETTIME)
set (CMAKE_REQUIRED_LIBRARIES)
@ -283,6 +287,7 @@ set (CMAKE_REQUIRED_INCLUDES)
set (CMAKE_REQUIRED_INCLUDES sys/socket.h)
check_function_exists (accept4 HAVE_ACCEPT4)
set (CMAKE_REQUIRED_INCLUDES)
endif()
add_definitions (-D_REENTRANT -D_THREAD_SAFE)
add_definitions (-DZMQ_CUSTOM_PLATFORM_HPP)
@ -314,13 +319,14 @@ if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
zmq_check_cxx_flag_prepend ("-Wextra")
endif ()
# TODO: why is -Wno-long-long defined differently than in configure.ac?
zmq_check_cxx_flag_prepend ("-Wno-long-long")
zmq_check_cxx_flag_prepend ("-Wno-uninitialized")
option (LIBZMQ_PEDANTIC "" ON)
option (LIBZMQ_WERROR "" OFF)
# TODO: why is -Wno-long-long defined differently than in configure.ac?
if (NOT MSVC)
zmq_check_cxx_flag_prepend ("-Wno-long-long")
zmq_check_cxx_flag_prepend ("-Wno-uninitialized")
if (LIBZMQ_PEDANTIC)
zmq_check_cxx_flag_prepend ("-pedantic")
@ -332,14 +338,18 @@ if (LIBZMQ_PEDANTIC)
zmq_check_cxx_flag_prepend ("-compat=5")
endif ()
endif ()
endif()
if (LIBZMQ_WERROR)
zmq_check_cxx_flag_prepend ("-Werror")
if(MSVC)
zmq_check_cxx_flag_prepend ("/WX")
else()
zmq_check_cxx_flag_prepend ("-Werror")
if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
zmq_check_cxx_flag_prepend ("-errwarn=%all")
endif()
endif()
endif ()
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
zmq_check_cxx_flag_prepend ("-mcpu=v9")
@ -372,7 +382,7 @@ endif ()
#-----------------------------------------------------------------------------
if (NOT CMAKE_CROSSCOMPILING)
if (NOT CMAKE_CROSSCOMPILING AND NOT MSVC)
zmq_check_sock_cloexec ()
zmq_check_o_cloexec ()
zmq_check_so_bindtodevice ()