summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt15
-rw-r--r--src/vlib/CMakeLists.txt2
-rw-r--r--src/vpp/CMakeLists.txt6
3 files changed, 19 insertions, 4 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)
diff --git a/src/vlib/CMakeLists.txt b/src/vlib/CMakeLists.txt
index 61e8ba7dd78..7ec9b2050e9 100644
--- a/src/vlib/CMakeLists.txt
+++ b/src/vlib/CMakeLists.txt
@@ -153,7 +153,7 @@ add_vpp_library(vlib
API_FILES
pci/pci_types.api
- LINK_LIBRARIES vppinfra svm ${CMAKE_DL_LIBS}
+ LINK_LIBRARIES vppinfra svm ${CMAKE_DL_LIBS} ${EPOLL_LIB}
DEPENDS api_headers
)
diff --git a/src/vpp/CMakeLists.txt b/src/vpp/CMakeLists.txt
index 37f57ac7823..84144e4d059 100644
--- a/src/vpp/CMakeLists.txt
+++ b/src/vpp/CMakeLists.txt
@@ -90,7 +90,7 @@ endif()
add_vpp_executable(vpp
ENABLE_EXPORTS
SOURCES ${VPP_SOURCES}
- LINK_LIBRARIES svm vlib vppinfra vlibmemory vnet Threads::Threads ${CMAKE_DL_LIBS}
+ LINK_LIBRARIES svm vlib vppinfra vlibmemory vnet Threads::Threads ${CMAKE_DL_LIBS} ${EPOLL_LIB}
DEPENDS vpp_version_h api_headers
)
@@ -99,7 +99,7 @@ add_vpp_executable(vpp
##############################################################################
add_vpp_executable(vppctl
SOURCES app/vppctl.c
- LINK_LIBRARIES vppinfra
+ LINK_LIBRARIES vppinfra ${EPOLL_LIB}
)
##############################################################################
@@ -122,7 +122,7 @@ add_vpp_executable(vpp_get_stats
add_vpp_executable(vpp_prometheus_export
SOURCES app/vpp_prometheus_export.c
- LINK_LIBRARIES vppapiclient vppinfra svm vlibmemoryclient
+ LINK_LIBRARIES vppapiclient vppinfra svm vlibmemoryclient ${EPOLL_LIB}
DEPENDS api_headers
)