diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b29ef8..1c770ba 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -170,5 +170,5 @@ add_custom_target(run-tests COMMAND ${CMAKE_CTEST_COMMAND} -T Test --no-compress add_subdirectory(bpf_program) add_subdirectory(bpf_generic) add_subdirectory(libnettracer) -add_subdirectory(nettracer) +#add_subdirectory(nettracer) add_subdirectory(nettracersrv) diff --git a/libnettracer/test/CMakeLists.txt b/libnettracer/test/CMakeLists.txt index 68fe7c4..a6d33cf 100644 --- a/libnettracer/test/CMakeLists.txt +++ b/libnettracer/test/CMakeLists.txt @@ -26,7 +26,7 @@ set(SOURCES connection_test.cpp connections_printing_test.cpp mock_bpf_maps_test.cpp - netstat_test.cpp + #netstat_test.cpp proc_tcp_test.cpp tuple_utils_test.cpp ) @@ -41,6 +41,7 @@ set(HEADERS PREPEND(HEADERS_FULL "${CMAKE_CURRENT_LIST_DIR}/cpp" ${HEADERS}) add_executable(libnettracer_test ${SOURCES_FULL} ${HEADERS_FULL}) + target_include_directories(libnettracer_test PRIVATE "${PROJECT_SOURCE_DIR}/libnettracer/src" @@ -49,6 +50,7 @@ target_include_directories(libnettracer_test target_link_libraries(libnettracer_test libnettracer) target_link_libraries(libnettracer_test -lpthread) target_link_libraries(libnettracer_test -lz) + if(DEFINED GITHUB_GTEST) target_link_libraries(libnettracer_test gmock_main) target_link_libraries(libnettracer_test gtest_main) diff --git a/nettracersrv/CMakeLists.txt b/nettracersrv/CMakeLists.txt index 2aee591..48b66c5 100644 --- a/nettracersrv/CMakeLists.txt +++ b/nettracersrv/CMakeLists.txt @@ -10,6 +10,13 @@ set(HEADERS PREPEND(HEADERS_FULL "${CMAKE_CURRENT_LIST_DIR}" ${HEADERS}) add_executable(nettracersrv ${SOURCES_FULL} ${HEADERS_FULL}) + +if(CMAKE_VERSION VERSION_GREATER "3.13") + target_link_options(nettracersrv PRIVATE -static-libgcc -static-libstdc++) +else() + target_link_libraries(nettracersrv -static-libgcc -static-libstdc++) +endif() + target_include_directories(nettracersrv PRIVATE "${PROJECT_SOURCE_DIR}/libnettracer/src"