From 478ddcdbd3110952510ab3c4f9618da5860018a2 Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Wed, 17 May 2023 09:48:15 +0200 Subject: Update CMakeLists.txt (#482) * Update CMakeLists.txt Link systemd libraries, to avoid underlinking of tests with -DWITH_SYSTEMD_SOCKET_ACTIVATION=ON [ 82%] Linking CXX executable gtest_dlt_daemon_gateway cd dlt-daemon-2.18.9/obj-x86_64-linux-gnu/tests && /usr/bin/cmake -E cmake_link_script CMakeFiles/gtest_dlt_daemon_gateway.dir/link.txt --verbose=1 /usr/bin/c++ -g -O2 -ffile-prefix-map=dlt-daemon-2.18.9=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -isystem /include -std=gnu++0x -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -rdynamic CMakeFiles/gtest_dlt_daemon_gateway.dir/gtest_dlt_daemon_gateway.cpp.o CMakeFiles/gtest_dlt_daemon_gateway.dir/__/systemd/3rdparty/sd-daemon.c.o -o gtest_dlt_daemon_gateway -Wl,-rpath,dlt-daemon-2.18.9/obj-x86_64-linux-gnu/src/daemon ../src/daemon/libdlt_daemon.so /usr/lib/x86_64-linux-gnu/libgtest.a /usr/lib/x86_64-linux-gnu/libgtest_main.a -lrt /usr/lib/x86_64-linux-gnu/libgtest.a /usr/bin/ld: ../src/daemon/libdlt_daemon.so: undefined reference to `sd_listen_fds_with_names' * Add systemd libs for WITH_SYSTEMD as well and removed deprecated versions Signed-off-by: Michael Methner --------- Signed-off-by: Michael Methner Co-authored-by: Michael Methner --- tests/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 579d730..d627ed2 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -21,8 +21,12 @@ else() set(LIBRARIES socket) endif() +if(WITH_SYSTEMD) + set(SYSTEMD_LIBS systemd) +endif(WITH_SYSTEMD) + set(DLT_LIBRARIES dlt ${GTEST_LIBS} ${LIBRARIES}) -set(DLT_DAEMON_LIBRARIES dlt_daemon ${GTEST_LIBS} ${LIBRARIES}) +set(DLT_DAEMON_LIBRARIES dlt_daemon ${GTEST_LIBS} ${LIBRARIES} ${SYSTEMD_LIBS}) set(DLT_CONTROL_LIBRARIES dlt dlt_control_common_lib ${GTEST_LIBS}) #Receiver used for QTs. add_test() is not required -- cgit v1.2.1