diff --git a/CMakeLists.txt b/CMakeLists.txt index 5875caf1c..b2947afce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -203,6 +203,11 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "DragonFly") set(FREEBSD TRUE) endif() +if(FREEBSD) + find_path(EPOLLSHIM_INCLUDE_DIR NAMES sys/epoll.h sys/timerfd.h HINTS /usr/local/include/libepoll-shim) + find_library(EPOLLSHIM_LIBS NAMES epoll-shim libepoll-shim HINTS /usr/local/lib) +endif() + # Configure MSVC Runtime if(MSVC) include(MSVCRuntime) @@ -653,7 +658,13 @@ if(UNIX OR CYGWIN) if (HAVE_SYS_EVENTFD_H) check_symbol_exists(eventfd_read sys/eventfd.h WITH_EVENTFD_READ_WRITE) endif() + if (FREEBSD) + list(APPEND CMAKE_REQUIRED_INCLUDES ${EPOLLSHIM_INCLUDE_DIR}) + endif() check_include_files(sys/timerfd.h HAVE_SYS_TIMERFD_H) + if (FREEBSD) + list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${EPOLLSHIM_INCLUDE_DIR}) + endif() check_include_files(poll.h HAVE_POLL_H) list(APPEND CMAKE_REQUIRED_LIBRARIES m) check_symbol_exists(ceill math.h HAVE_MATH_C99_LONG_DOUBLE) diff --git a/uwac/libuwac/CMakeLists.txt b/uwac/libuwac/CMakeLists.txt index 6a98077e1..246d4bfe8 100644 --- a/uwac/libuwac/CMakeLists.txt +++ b/uwac/libuwac/CMakeLists.txt @@ -40,6 +40,9 @@ generate_protocol_file(xdg-shell) generate_protocol_file(ivi-application) generate_protocol_file(fullscreen-shell) +if(FREEBSD) + include_directories(${EPOLLSHIM_INCLUDE_DIR}) +endif() include_directories(${WAYLAND_INCLUDE_DIR}) include_directories(${XKBCOMMON_INCLUDE_DIR}) include_directories("${CMAKE_SOURCE_DIR}/uwac/include") @@ -69,7 +72,7 @@ if (WITH_LIBRARY_VERSIONING) set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${UWAC_VERSION} SOVERSION ${UWAC_API_VERSION}) endif() -target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS} ${PRIVATE_KEYWORD} ${WAYLAND_LIBS} ${XKBCOMMON_LIBS} freerdp) +target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS} ${PRIVATE_KEYWORD} ${WAYLAND_LIBS} ${XKBCOMMON_LIBS} ${EPOLLSHIM_LIBS} freerdp) install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT uwac) diff --git a/winpr/libwinpr/synch/CMakeLists.txt b/winpr/libwinpr/synch/CMakeLists.txt index 7c86c34e7..07af9a072 100644 --- a/winpr/libwinpr/synch/CMakeLists.txt +++ b/winpr/libwinpr/synch/CMakeLists.txt @@ -30,6 +30,11 @@ winpr_module_add( timer.c wait.c) +if(FREEBSD) + winpr_include_directory_add(${EPOLLSHIM_INCLUDE_DIR}) + winpr_library_add(${EPOLLSHIM_LIBS}) +endif() + if((NOT WIN32) AND (NOT APPLE) AND (NOT ANDROID) AND (NOT OPENBSD)) winpr_library_add(rt) endif()