Skip to content

Commit

Permalink
Update CMakeLists.txt (#482)
Browse files Browse the repository at this point in the history
* 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 <mmethner@de.adit-jv.com>

---------

Signed-off-by: Michael Methner <mmethner@de.adit-jv.com>
Co-authored-by: Michael Methner <mmethner@de.adit-jv.com>
  • Loading branch information
LocutusOfBorg and Michael Methner committed May 17, 2023
1 parent f64063b commit 478ddcd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 478ddcd

Please sign in to comment.