From b492e34ab9b25f5ff446dba7c6fcc00c5f227aa2 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Wed, 23 Jul 2025 19:11:07 +0100 Subject: [PATCH] Fix linking tests against static libloot --- cpp/cmake/tests.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cpp/cmake/tests.cmake b/cpp/cmake/tests.cmake index 5485b680..9f05e593 100644 --- a/cpp/cmake/tests.cmake +++ b/cpp/cmake/tests.cmake @@ -73,7 +73,6 @@ set(LIBLOOT_INTERFACE_TESTS_ALL_SOURCES # Build API tests. add_executable(libloot_tests ${LIBLOOT_INTERFACE_TESTS_ALL_SOURCES}) -add_dependencies(libloot_tests loot) target_link_libraries(libloot_tests PRIVATE loot GTest::gtest_main) enable_testing() @@ -90,7 +89,7 @@ target_include_directories(libloot_tests SYSTEM PRIVATE if(CMAKE_SYSTEM_NAME STREQUAL "Windows") target_compile_definitions(libloot_tests PRIVATE UNICODE _UNICODE) - if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") + if((NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") OR NOT LIBLOOT_BUILD_SHARED) target_compile_definitions(libloot_tests PRIVATE LOOT_STATIC) endif()