Commit 06e0c077 authored by Simon Giesecke's avatar Simon Giesecke

Problem: cmake run is very slow with MSVC

Solution: skip tests than can never succeed with MSVC
parent 9df85122
...@@ -103,16 +103,17 @@ set (POLLER "" CACHE STRING "Choose polling system for I/O threads. valid values ...@@ -103,16 +103,17 @@ set (POLLER "" CACHE STRING "Choose polling system for I/O threads. valid values
include (CheckFunctionExists) include (CheckFunctionExists)
include (CheckTypeSize) include (CheckTypeSize)
if (POLLER STREQUAL "") if (NOT MSVC)
if (POLLER STREQUAL "")
set (CMAKE_REQUIRED_INCLUDES sys/event.h) set (CMAKE_REQUIRED_INCLUDES sys/event.h)
check_function_exists (kqueue HAVE_KQUEUE) check_function_exists (kqueue HAVE_KQUEUE)
set (CMAKE_REQUIRED_INCLUDES) set (CMAKE_REQUIRED_INCLUDES)
if (HAVE_KQUEUE) if (HAVE_KQUEUE)
set (POLLER "kqueue") set (POLLER "kqueue")
endif() endif()
endif () endif ()
if (POLLER STREQUAL "") if (POLLER STREQUAL "")
set (CMAKE_REQUIRED_INCLUDES sys/epoll.h) set (CMAKE_REQUIRED_INCLUDES sys/epoll.h)
check_function_exists (epoll_create HAVE_EPOLL) check_function_exists (epoll_create HAVE_EPOLL)
set (CMAKE_REQUIRED_INCLUDES) set (CMAKE_REQUIRED_INCLUDES)
...@@ -123,34 +124,35 @@ if (POLLER STREQUAL "") ...@@ -123,34 +124,35 @@ if (POLLER STREQUAL "")
set (ZMQ_IOTHREAD_POLLER_USE_EPOLL_CLOEXEC 1) set (ZMQ_IOTHREAD_POLLER_USE_EPOLL_CLOEXEC 1)
endif () endif ()
endif () endif ()
endif () endif ()
if (POLLER STREQUAL "") if (POLLER STREQUAL "")
set (CMAKE_REQUIRED_INCLUDES sys/devpoll.h) set (CMAKE_REQUIRED_INCLUDES sys/devpoll.h)
check_type_size ("struct pollfd" DEVPOLL) check_type_size ("struct pollfd" DEVPOLL)
set (CMAKE_REQUIRED_INCLUDES) set (CMAKE_REQUIRED_INCLUDES)
if (HAVE_DEVPOLL) if (HAVE_DEVPOLL)
set (POLLER "devpoll") set (POLLER "devpoll")
endif () endif ()
endif () endif ()
if (POLLER STREQUAL "") if (POLLER STREQUAL "")
set (CMAKE_REQUIRED_INCLUDES sys/pollset.h) set (CMAKE_REQUIRED_INCLUDES sys/pollset.h)
check_function_exists (pollset_create HAVE_POLLSET) check_function_exists (pollset_create HAVE_POLLSET)
set (CMAKE_REQUIRED_INCLUDES) set (CMAKE_REQUIRED_INCLUDES)
if (HAVE_POLLSET) if (HAVE_POLLSET)
set (POLLER "pollset") set (POLLER "pollset")
endif() endif()
endif () endif ()
if (POLLER STREQUAL "") if (POLLER STREQUAL "")
set (CMAKE_REQUIRED_INCLUDES poll.h) set (CMAKE_REQUIRED_INCLUDES poll.h)
check_function_exists (poll HAVE_POLL) check_function_exists (poll HAVE_POLL)
set (CMAKE_REQUIRED_INCLUDES) set (CMAKE_REQUIRED_INCLUDES)
if (HAVE_POLL) if (HAVE_POLL)
set (POLLER "poll") set (POLLER "poll")
endif () endif ()
endif () endif ()
endif()
if (POLLER STREQUAL "") if (POLLER STREQUAL "")
if (WIN32) if (WIN32)
...@@ -213,18 +215,19 @@ include (CMakeDependentOption) ...@@ -213,18 +215,19 @@ include (CMakeDependentOption)
include (CheckCXXSymbolExists) include (CheckCXXSymbolExists)
include (CheckSymbolExists) include (CheckSymbolExists)
check_include_files (ifaddrs.h ZMQ_HAVE_IFADDRS)
check_include_files (windows.h ZMQ_HAVE_WINDOWS) check_include_files (windows.h ZMQ_HAVE_WINDOWS)
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND CMAKE_SYSTEM_VERSION STREQUAL "10.0") if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND CMAKE_SYSTEM_VERSION STREQUAL "10.0")
SET(ZMQ_HAVE_WINDOWS_UWP ON) SET(ZMQ_HAVE_WINDOWS_UWP ON)
ADD_DEFINITIONS(-D_WIN32_WINNT=_WIN32_WINNT_WIN10) ADD_DEFINITIONS(-D_WIN32_WINNT=_WIN32_WINNT_WIN10)
endif() endif()
check_include_files (sys/uio.h ZMQ_HAVE_UIO) if (NOT MSVC)
check_include_files (sys/eventfd.h ZMQ_HAVE_EVENTFD) check_include_files (ifaddrs.h ZMQ_HAVE_IFADDRS)
if (ZMQ_HAVE_EVENTFD AND NOT CMAKE_CROSSCOMPILING) 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 () zmq_check_efd_cloexec ()
endif () endif ()
endif()
if (ZMQ_HAVE_WINDOWS) if (ZMQ_HAVE_WINDOWS)
# Cannot use check_library_exists because the symbol is always declared as char(*)(void) # Cannot use check_library_exists because the symbol is always declared as char(*)(void)
...@@ -264,25 +267,27 @@ if (WIN32 AND NOT CYGWIN) ...@@ -264,25 +267,27 @@ if (WIN32 AND NOT CYGWIN)
endif () endif ()
endif () endif ()
set (CMAKE_REQUIRED_LIBRARIES rt) if (NOT MSVC)
check_function_exists (clock_gettime HAVE_CLOCK_GETTIME) set (CMAKE_REQUIRED_LIBRARIES rt)
set (CMAKE_REQUIRED_LIBRARIES) check_function_exists (clock_gettime HAVE_CLOCK_GETTIME)
set (CMAKE_REQUIRED_LIBRARIES)
set (CMAKE_REQUIRED_INCLUDES unistd.h) set (CMAKE_REQUIRED_INCLUDES unistd.h)
check_function_exists (fork HAVE_FORK) check_function_exists (fork HAVE_FORK)
set (CMAKE_REQUIRED_INCLUDES) set (CMAKE_REQUIRED_INCLUDES)
set (CMAKE_REQUIRED_INCLUDES sys/time.h) set (CMAKE_REQUIRED_INCLUDES sys/time.h)
check_function_exists (gethrtime HAVE_GETHRTIME) check_function_exists (gethrtime HAVE_GETHRTIME)
set (CMAKE_REQUIRED_INCLUDES) set (CMAKE_REQUIRED_INCLUDES)
set (CMAKE_REQUIRED_INCLUDES stdlib.h) set (CMAKE_REQUIRED_INCLUDES stdlib.h)
check_function_exists (mkdtemp HAVE_MKDTEMP) check_function_exists (mkdtemp HAVE_MKDTEMP)
set (CMAKE_REQUIRED_INCLUDES) set (CMAKE_REQUIRED_INCLUDES)
set (CMAKE_REQUIRED_INCLUDES sys/socket.h) set (CMAKE_REQUIRED_INCLUDES sys/socket.h)
check_function_exists (accept4 HAVE_ACCEPT4) check_function_exists (accept4 HAVE_ACCEPT4)
set (CMAKE_REQUIRED_INCLUDES) set (CMAKE_REQUIRED_INCLUDES)
endif()
add_definitions (-D_REENTRANT -D_THREAD_SAFE) add_definitions (-D_REENTRANT -D_THREAD_SAFE)
add_definitions (-DZMQ_CUSTOM_PLATFORM_HPP) add_definitions (-DZMQ_CUSTOM_PLATFORM_HPP)
...@@ -314,14 +319,15 @@ if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") ...@@ -314,14 +319,15 @@ if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
zmq_check_cxx_flag_prepend ("-Wextra") zmq_check_cxx_flag_prepend ("-Wextra")
endif () 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_PEDANTIC "" ON)
option (LIBZMQ_WERROR "" OFF) option (LIBZMQ_WERROR "" OFF)
if (LIBZMQ_PEDANTIC) # 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") zmq_check_cxx_flag_prepend ("-pedantic")
if (${CMAKE_CXX_COMPILER_ID} MATCHES "Intel") if (${CMAKE_CXX_COMPILER_ID} MATCHES "Intel")
...@@ -331,14 +337,18 @@ if (LIBZMQ_PEDANTIC) ...@@ -331,14 +337,18 @@ if (LIBZMQ_PEDANTIC)
if (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro") if (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro")
zmq_check_cxx_flag_prepend ("-compat=5") zmq_check_cxx_flag_prepend ("-compat=5")
endif () endif ()
endif () endif ()
endif()
if (LIBZMQ_WERROR) if (LIBZMQ_WERROR)
zmq_check_cxx_flag_prepend ("-Werror") if(MSVC)
zmq_check_cxx_flag_prepend ("/WX") zmq_check_cxx_flag_prepend ("/WX")
else()
zmq_check_cxx_flag_prepend ("-Werror")
if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
zmq_check_cxx_flag_prepend ("-errwarn=%all") zmq_check_cxx_flag_prepend ("-errwarn=%all")
endif() endif()
endif()
endif () endif ()
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc") if (CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
...@@ -372,7 +382,7 @@ endif () ...@@ -372,7 +382,7 @@ endif ()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
if (NOT CMAKE_CROSSCOMPILING) if (NOT CMAKE_CROSSCOMPILING AND NOT MSVC)
zmq_check_sock_cloexec () zmq_check_sock_cloexec ()
zmq_check_o_cloexec () zmq_check_o_cloexec ()
zmq_check_so_bindtodevice () zmq_check_so_bindtodevice ()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment