From 5009fbfbe440521b9d2d320e5027bbc57f1003aa Mon Sep 17 00:00:00 2001 From: Alexander Shaduri Date: Tue, 15 Feb 2022 13:42:43 +0400 Subject: [PATCH] Fixed test link errors on Debian 10. --- src/applib/tests/CMakeLists.txt | 7 ++++--- src/hz/tests/CMakeLists.txt | 7 ++++--- src/test_all/CMakeLists.txt | 3 ++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/applib/tests/CMakeLists.txt b/src/applib/tests/CMakeLists.txt index dbc4f46..2793d19 100644 --- a/src/applib/tests/CMakeLists.txt +++ b/src/applib/tests/CMakeLists.txt @@ -17,8 +17,9 @@ target_sources(applib_tests PRIVATE test_app_pcrecpp.cpp test_smartctl_version_parser.cpp ) -target_link_libraries(applib_tests PRIVATE - applib - Catch2 +target_link_libraries(applib_tests + PUBLIC # must be public as the target is an object library + applib + Catch2 ) diff --git a/src/hz/tests/CMakeLists.txt b/src/hz/tests/CMakeLists.txt index a627d2a..0016219 100644 --- a/src/hz/tests/CMakeLists.txt +++ b/src/hz/tests/CMakeLists.txt @@ -18,8 +18,9 @@ target_sources(hz_tests PRIVATE test_string_algo.cpp test_string_num.cpp ) -target_link_libraries(hz_tests PRIVATE - hz - Catch2 +target_link_libraries(hz_tests + PUBLIC # must be public as the target is an object library + hz + Catch2 ) diff --git a/src/test_all/CMakeLists.txt b/src/test_all/CMakeLists.txt index 7568e79..8b48526 100644 --- a/src/test_all/CMakeLists.txt +++ b/src/test_all/CMakeLists.txt @@ -20,9 +20,10 @@ target_sources(test_all PRIVATE ) target_link_libraries(test_all PRIVATE libdebug + Catch2 + # Object libraries containing tests applib_tests hz_tests - Catch2 ) if (NOT CMAKE_CROSSCOMPILING)