From 134843cff8ba9796770ee58c1f3411ef3a01cc92 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sun, 5 May 2024 07:44:53 -0400 Subject: [PATCH] build: Fix shared library build. * driver/CMakeLists.txt (DRIVER_SOURCES): Add missing headers. * userspace/libscap/engine/gvisor/CMakeLists.txt [BUILD_SHARED_LIBS]: Add missing include directories. * test/libscap/CMakeLists.txt (LIBSCAP_TESTS_LIBRARIES): Add ${PROTOBUF_LIB}. Fixes: #1820 Signed-off-by: Maxim Cournoyer --- driver/CMakeLists.txt | 5 +++++ test/libscap/CMakeLists.txt | 1 + userspace/libscap/engine/gvisor/CMakeLists.txt | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/driver/CMakeLists.txt b/driver/CMakeLists.txt index 80229cc034a..38659e2724b 100644 --- a/driver/CMakeLists.txt +++ b/driver/CMakeLists.txt @@ -152,6 +152,11 @@ set(DRIVER_SOURCES ppm_consumer.h capture_macro.h socketcall_to_syscall.h + syscall_compat_loongarch64.h + syscall_compat_ppc64le.h + syscall_compat_riscv64.h + syscall_compat_s390x.h + syscall_compat_x86_64.h syscall_ia32_64_map.c ) diff --git a/test/libscap/CMakeLists.txt b/test/libscap/CMakeLists.txt index e88603ebd03..b2a865c08e8 100644 --- a/test/libscap/CMakeLists.txt +++ b/test/libscap/CMakeLists.txt @@ -45,6 +45,7 @@ set(LIBSCAP_TESTS_LIBRARIES "${GTEST_LIB}" "${GTEST_MAIN_LIB}" "${CMAKE_THREAD_LIBS_INIT}" + "${PROTOBUF_LIB}" scap ) diff --git a/userspace/libscap/engine/gvisor/CMakeLists.txt b/userspace/libscap/engine/gvisor/CMakeLists.txt index 6dfbafb146f..875847b5da2 100644 --- a/userspace/libscap/engine/gvisor/CMakeLists.txt +++ b/userspace/libscap/engine/gvisor/CMakeLists.txt @@ -76,6 +76,14 @@ if (BUILD_SHARED_LIBS) add_dependencies(scap_engine_gvisor_o uthash) add_dependencies(scap scap_engine_gvisor_o) target_sources(scap PRIVATE $) + + target_include_directories(scap_engine_gvisor_o + PRIVATE + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/userspace + ) else() add_library(scap_engine_gvisor ${scap_engine_gvisor_sources}