From eabaf54d748e2bcf791872d2e2a545a7bac575b6 Mon Sep 17 00:00:00 2001 From: Schaich Date: Mon, 22 Mar 2021 21:58:34 +0900 Subject: [PATCH] Test both the dynamic and the static library --- backend/tests/CMakeLists.txt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/backend/tests/CMakeLists.txt b/backend/tests/CMakeLists.txt index 7a6f8dc5..4c8b8ca7 100644 --- a/backend/tests/CMakeLists.txt +++ b/backend/tests/CMakeLists.txt @@ -21,11 +21,14 @@ if(NOT EXISTS ${BWIPP_PS}) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tools) endif() -add_library(testcommon testcommon.c testcommon.h) +set(testcommon_SRCS testcommon.c testcommon.h) + +add_library(testcommon ${testcommon_SRCS}) +target_link_libraries(testcommon zint) + if(ZINT_STATIC) - target_link_libraries(testcommon zint-static) -else() - target_link_libraries(testcommon zint) + add_library(testcommon-static ${testcommon_SRCS}) + target_link_libraries(testcommon-static zint-static) endif() macro(zint_add_test test_name test_command) @@ -33,6 +36,11 @@ macro(zint_add_test test_name test_command) add_executable(${test_command} ${test_command}.c) target_link_libraries(${test_command} testcommon ${ADDITIONAL_LIBS}) add_test(${test_name} ${test_command}) + if(ZINT_STATIC) + add_executable(${test_command}-static ${test_command}.c) + target_link_libraries(${test_command}-static testcommon-static ${ADDITIONAL_LIBS}) + add_test(${test_name}-static ${test_command}-static) + endif() endmacro() zint_add_test(2of5 test_2of5)