summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAlan Antonuk <alan.antonuk@gmail.com>2015-06-01 23:38:08 -0700
committerAlan Antonuk <alan.antonuk@gmail.com>2015-06-01 23:50:27 -0700
commit6e9565c91fca092f69111a40fa56eabe41c60ff4 (patch)
treee0ad88f5fcc84c4afa4ef1a79eb88aa75e6213b2 /CMakeLists.txt
parent3f0d7454a3c31464fa771879d9922880e86b4a17 (diff)
downloadrabbitmq-c-6e9565c91fca092f69111a40fa56eabe41c60ff4.tar.gz
Lib: add select()-based implementation of poll()
Add select() based poll() implementation for platforms that either support this better (Win32) or don't support poll().
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3be7535..095805f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -120,6 +120,24 @@ else (WIN32)
endif (WIN32)
cmake_pop_check_state()
+cmake_push_check_state()
+set(CMAKE_REQUIRED_INCLUDES "poll.h")
+check_function_exists(poll HAVE_POLL)
+set(CMAKE_REQUIRED_INCLUDES )
+if (NOT HAVE_POLL)
+ if (WIN32)
+ set(HAVE_SELECT 1)
+ else()
+ set(CMAKE_REQUIRED_INCLUDES sys/select.h)
+ check_function_exists(select HAVE_SELECT)
+ set(CMAKE_REQUIRED_INCLUDES )
+ endif()
+ if (NOT HAVE_SELECT)
+ message(FATAL_ERROR "rabbitmq-c requires poll() or select() to be available")
+ endif()
+endif()
+cmake_pop_check_state()
+
check_library_exists(rt clock_gettime "time.h" CLOCK_GETTIME_NEEDS_LIBRT)
if (CLOCK_GETTIME_NEEDS_LIBRT)
set(LIBRT rt)