Use epoll on linux by default, poll otherwise

This commit is contained in:
Florent Le Coz
2014-04-30 02:30:19 +02:00
parent dd552b1e34
commit 18b27793de
+6 -2
View File
@@ -39,8 +39,12 @@ else()
message("Building without systemd daemon support.")
endif()
set(POLLER "POLL" CACHE STRING
"Choose the poller between POLL and EPOLL (Linux-only)")
set(POLLER_DOCSTRING "Choose the poller between POLL and EPOLL (Linux-only)")
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(POLLER "EPOLL" CACHE STRING ${POLLER_DOCSTRING})
else()
set(POLLER "POLL" CACHE STRING ${POLLER_DOCSTRING})
endif()
if((NOT ${POLLER} MATCHES "POLL") AND
(NOT ${POLLER} MATCHES "EPOLL"))
message(FATAL_ERROR "POLLER must be either POLL or EPOLL")