Skip to content

Commit

Permalink
build: Fix shared library build.
Browse files Browse the repository at this point in the history
* driver/CMakeLists.txt (DRIVER_SOURCES): Add missing headers.
* test/libscap/CMakeLists.txt (LIBSCAP_TESTS_LIBRARIES): Add
${PROTOBUF_LIB}.
* userspace/libsinsp/test/CMakeLists.txt (unit-test-libsinsp): Link to
libgrpc++ to avoid a missing DSO error.
* userspace/libscap/CMakeLists.txt: Do not hardcode STATIC type for
scap_event_schema and scap_platform libraries, so as to install
them (they are referenced in the pkg-config files).

Fixes: #1820
Signed-off-by: Maxim Cournoyer <[email protected]>
  • Loading branch information
Apteryks committed Jan 23, 2025
1 parent aee3166 commit 209ebb6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
5 changes: 5 additions & 0 deletions driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,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
)

Expand Down
4 changes: 3 additions & 1 deletion test/libscap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ set(LIBSCAP_TESTS_INCLUDE
# Needed by gtest
find_package(Threads)

set(LIBSCAP_TESTS_LIBRARIES "${GTEST_LIB}" "${GTEST_MAIN_LIB}" "${CMAKE_THREAD_LIBS_INIT}" scap)
set(LIBSCAP_TESTS_LIBRARIES "${GTEST_LIB}" "${GTEST_MAIN_LIB}" "${CMAKE_THREAD_LIBS_INIT}"
"${PROTOBUF_LIB}" scap
)

set(LIBSCAP_TESTS_DEPENDENCIES gtest scap)

Expand Down
2 changes: 1 addition & 1 deletion userspace/libscap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ target_include_directories(
target_link_libraries(scap PRIVATE scap_error "${ZLIB_LIB}")

add_library(
scap_event_schema STATIC
scap_event_schema
scap_event.c
ppm_sc_names.c
scap_print_event.c
Expand Down
2 changes: 1 addition & 1 deletion userspace/libscap/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# the License.
#
add_library(
scap_platform STATIC
scap_platform
scap_linux_platform.c
scap_linux_hostinfo_platform.c
scap_procs.c
Expand Down
8 changes: 7 additions & 1 deletion userspace/libsinsp/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,13 @@ target_include_directories(
)

target_link_libraries(
unit-test-libsinsp sinsp "${GTEST_LIB}" "${GTEST_MAIN_LIB}" "${TBB_LIB}" "${JSONCPP_LIB}"
unit-test-libsinsp
sinsp
"${GRPCPP_LIB}"
"${GTEST_LIB}"
"${GTEST_MAIN_LIB}"
"${TBB_LIB}"
"${JSONCPP_LIB}"
)

# Add some additional include directories associated with `ADDITIONAL_SINSP_TESTS_SUITE`
Expand Down

0 comments on commit 209ebb6

Please sign in to comment.