File tree Expand file tree Collapse file tree 4 files changed +14
-6
lines changed
Expand file tree Collapse file tree 4 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,16 @@ project(
2424 LANGUAGES CXX
2525)
2626
27+ # Check the thread library info early as setting compiler flags seems to
28+ # interfere with the detection and causes CMAKE_THREAD_LIBS_INIT to not
29+ # include -lpthread when it should.
30+ if (LIBTINS_BUILD_TESTS)
31+ if (NOT TARGET Threads::Threads)
32+ find_package (Threads REQUIRED )
33+ endif ()
34+ set (LINK_LIBS ${LINK_LIBS} Threads::Threads)
35+ endif ()
36+
2737# Compilation flags.
2838IF (MSVC )
2939 # Don't always use Wall, since VC's /Wall is ridiculously verbose.
Original file line number Diff line number Diff line change @@ -73,7 +73,9 @@ endif (NOT PCAP_LINKS_SOLO)
7373
7474include (CheckFunctionExists )
7575set (CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARY} )
76- check_function_exists (pcap_get_pfring_id HAVE_PF_RING )
76+ # this is not actually used, is not part of normal libpcap, and
77+ # causes breakage in some build environments, eg, bookworm docker image
78+ #check_function_exists(pcap_get_pfring_id HAVE_PF_RING)
7779check_function_exists (pcap_set_immediate_mode HAVE_PCAP_IMMEDIATE_MODE )
7880check_function_exists (pcap_set_tstamp_precision HAVE_PCAP_TIMESTAMP_PRECISION )
7981set (CMAKE_REQUIRED_LIBRARIES)
Original file line number Diff line number Diff line change @@ -6,9 +6,6 @@ INCLUDE_DIRECTORIES(
66 ${PCAP_INCLUDE_DIR}
77)
88
9- # Find pthread library
10- FIND_PACKAGE (Threads REQUIRED )
11-
129LINK_DIRECTORIES (
1310 ${GOOGLETEST_LIBRARY}
1411)
@@ -104,4 +101,3 @@ IF(LIBTINS_ENABLE_DOT11)
104101 CREATE_TEST (wpa2_decrypt )
105102 ENDIF ()
106103ENDIF ()
107-
Original file line number Diff line number Diff line change 4242 ninja
4343
4444commands =
45- cmake -G {posargs:" Unix Makefiles" } -S . -B build -DCMAKE_BUILD_TYPE =Release -DCMAKE_INSTALL_PREFIX ={env:PREFIX} -DLIBTINS_ENABLE_CXX11 =ON -DLIBTINS_ENABLE_ACK_TRACKER =OFF -DLIBTINS_ENABLE_WPA2 =OFF -DLIBTINS_ENABLE_DOT11 =OFF
45+ cmake -G {posargs:" Unix Makefiles" } -S . -B build -DCMAKE_BUILD_TYPE =Release -DCMAKE_INSTALL_PREFIX ={env:PREFIX} -DLIBTINS_ENABLE_CXX11 =ON -DLIBTINS_ENABLE_ACK_TRACKER =OFF -DLIBTINS_ENABLE_WPA2 =OFF -DLIBTINS_ENABLE_DOT11 =OFF - DLIBTINS_BUILD_TESTS =OFF
4646 cmake --build build -j 4 --target install
4747 bash -c ' ls -lh $PREFIX/*'
4848
You can’t perform that action at this time.
0 commit comments