diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2023-09-10 19:11:58 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2023-09-10 19:11:58 +0200 |
commit | 96b0a8a4749f56244b9d6841de3696ab7fe1fd0e (patch) | |
tree | 048ff902133f63e4a9addf24b85d43eb3c8f131c /cmake | |
parent | 091fd4d11654949e2d8e6c8f03cc9c675d472a91 (diff) |
Add event I/O abstraction.
* required to support non-Linux OS e.g. Mac OS X / BSD
* see Github issue #19
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/CheckEpoll.cmake | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/cmake/CheckEpoll.cmake b/cmake/CheckEpoll.cmake new file mode 100644 index 000000000..766d7470f --- /dev/null +++ b/cmake/CheckEpoll.cmake @@ -0,0 +1,28 @@ +# - Check if the system supports epoll. +# CHECK_EPOLL(<var>) +# <var> - variable to store the result +# (1 for success, empty for failure) + +#============================================================================= +# This software is in the public domain, furnished "as is", without technical +# support, and with no warranty, express or implied, as to its usefulness for +# any purpose. +#============================================================================= + +macro(CHECK_EPOLL VARIABLE) + if(UNIX) + if("${VARIABLE}" MATCHES "^${VARIABLE}$") + message(STATUS "Check if the system supports epoll") + include(CheckSymbolExists) + check_symbol_exists(epoll_create "sys/epoll.h" EPOLL_PROTOTYPE_EXISTS) + + if(EPOLL_PROTOTYPE_EXISTS) + message(STATUS "Check if the system supports epoll - yes") + set(${VARIABLE} 1 CACHE INTERNAL "Result of CHECK_EPOLL" FORCE) + else(EPOLL_PROTOTYPE_EXISTS) + message(STATUS "Check if the system supports epoll - no") + set(${VARIABLE} "" CACHE INTERNAL "Result of CHECK_EPOLL" FORCE) + endif(EPOLL_PROTOTYPE_EXISTS) + endif("${VARIABLE}" MATCHES "^${VARIABLE}$") + endif(UNIX) +endmacro(CHECK_EPOLL) |