[cmake] help cmake on FreeBSD find sys/event.h

sys/event.h does not compile standalone, so check_include_files() fails

Add compiler flags -include sys/types.h so that the compile check passes

This allows cmake builds on FreeBSD to detect and use kqueue.
This commit is contained in:
Glenn Strauss 2019-05-05 02:52:31 -04:00
parent d836d20317
commit 3abbb8dc4b
1 changed files with 2 additions and 0 deletions

View File

@ -78,7 +78,9 @@ endif()
check_include_files(sys/devpoll.h HAVE_SYS_DEVPOLL_H)
check_include_files(sys/epoll.h HAVE_SYS_EPOLL_H)
set(CMAKE_REQUIRED_FLAGS "-include sys/types.h")
check_include_files(sys/event.h HAVE_SYS_EVENT_H)
set(CMAKE_REQUIRED_FLAGS)
check_include_files(sys/mman.h HAVE_SYS_MMAN_H)
check_include_files(sys/poll.h HAVE_SYS_POLL_H)
check_include_files(sys/port.h HAVE_SYS_PORT_H)