summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorTom Jones <thj@freebsd.org>2024-01-29 14:38:19 +0000
committerDamjan Marion <dmarion@0xa5.net>2024-02-23 10:07:49 +0000
commit5ed27ef8b6362ee2a30dd8f6094fa8ca32a97439 (patch)
tree69c481d7b8ac3f6025739a773989c3702933209f /src/CMakeLists.txt
parent72cb9f7e44555965873bc0aa44fa030be3a79167 (diff)
build: Discover libepoll-shim on FreeBSD
FreeBSD doesn't offer epoll, but an implementation which uses kqueue is available as an external library. On FreeBSD in subsystems which require epoll have cmake look for libepoll-shim. Type: improvement Change-Id: Iafd5406a9e2ebaa53fd94034489ffbbf87a7d040 Signed-off-by: Tom Jones <thj@freebsd.org>
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9415c4d44fb..68d0a4fe64e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -245,6 +245,21 @@ include(cmake/exec.cmake)
include(cmake/plugin.cmake)
##############################################################################
+# FreeBSD - use epoll-shim
+##############################################################################
+set(EPOLL_LIB "")
+if("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
+ find_path(EPOLL_SHIM_INCLUDE_DIR NAMES sys/epoll.h HINTS /usr/local/include/libepoll-shim)
+ find_library(EPOLL_SHIM_LIB NAMES epoll-shim HINTS /usr/local/lib)
+
+ if(EPOLL_SHIM_INCLUDE_DIR AND EPOLL_SHIM_LIB)
+ message(STATUS "Found epoll-shim in ${EPOLL_SHIM_INCLUDE_DIR}")
+ include_directories(${EPOLL_SHIM_INCLUDE_DIR})
+ string(JOIN " " EPOLL_LIB "${EPOLL_SHIM_LIB}")
+ endif()
+endif()
+
+##############################################################################
# subdirs - order matters
##############################################################################
option(VPP_HOST_TOOLS_ONLY "Build only host tools" OFF)