File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
4242add_executable (libkqueue-test ${LIBKQUEUE_TEST_SOURCES} )
4343target_include_directories (libkqueue-test
4444 PRIVATE
45- "${CMAKE_SOURCE_DIR} "
46- "${CMAKE_SOURCE_DIR} /include" )
45+ "${CMAKE_SOURCE_DIR} "
46+ "${CMAKE_SOURCE_DIR} /include" )
4747if (WIN32 )
4848 target_compile_definitions (libkqueue-test
4949 PRIVATE
@@ -61,9 +61,25 @@ endif()
6161# Don't link against -lkqueue on OSX and FreeBSD
6262#
6363if (NOT "${CMAKE_SYSTEM_NAME} " MATCHES "(Darwin|FreeBSD)" )
64+ # Prefer -pthread on POSIX
65+ set (THREADS_PREFER_PTHREAD_FLAG ON )
66+ find_package (Threads REQUIRED )
67+
68+ # Use our locally built libkqueue
69+ find_library (KQUEUE_LIB
70+ NAMES kqueue
71+ PATHS ${PROJECT_SOURCE_DIR} /../
72+ NO_DEFAULT_PATH
73+ REQUIRED
74+ )
75+
76+ # Allow test program to find libkqueue headers
77+ target_include_directories (libkqueue-test PRIVATE
78+ ${PROJECT_SOURCE_DIR} /../include )
79+
6480 target_link_libraries (libkqueue-test
6581 PRIVATE
66- kqueue
82+ ${KQUEUE_LIB}
6783 Threads::Threads )
6884endif ()
6985
You can’t perform that action at this time.
0 commit comments