From c84915e212db0d823f1ce5747329082c45cb471e Mon Sep 17 00:00:00 2001 From: Schaich Date: Mon, 22 Mar 2021 20:23:31 +0900 Subject: [PATCH] Linking the tests against zint-static if available Linking against the dynamic zint library requires LD_LIBRARY_PATH and friends to be set, which complicates the test setup. On the long run, we want to be able to test both the dynamic and the static (at the same time), though --- backend/tests/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/tests/CMakeLists.txt b/backend/tests/CMakeLists.txt index e65e4970..fc7a2e8e 100644 --- a/backend/tests/CMakeLists.txt +++ b/backend/tests/CMakeLists.txt @@ -17,7 +17,11 @@ if(NOT EXISTS ${BWIPP_PS}) endif() add_library(testcommon testcommon.c testcommon.h) -target_link_libraries(testcommon zint) +if(ZINT_STATIC) + target_link_libraries(testcommon zint-static) +else() + target_link_libraries(testcommon zint) +endif() macro(zint_add_test test_name test_command) set(ADDITIONAL_LIBS "${ARGN}" ${LIBRARY_FLAGS})