From db84e7f30ae8a1ad17cc30236179569ea70d5ea3 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 23 Mar 2023 16:20:53 +0100 Subject: [PATCH] Fix blender_test not re-linked on macOS after changes The Linux worked due to the libraries provided as a dependency via `EXTRA_LIBS "${TEST_LIBS}"` with extra whole archive. While on Windows and macOS the whole-archive is not needed the dependency from the library to the blender_test is still needed. Solves the issue when modifying asset_catalog_test.cc on macOS does not make blender_test to be relinked. --- tests/gtests/runner/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/gtests/runner/CMakeLists.txt b/tests/gtests/runner/CMakeLists.txt index eac76db22db..94f1d4d580b 100644 --- a/tests/gtests/runner/CMakeLists.txt +++ b/tests/gtests/runner/CMakeLists.txt @@ -20,6 +20,10 @@ endif() get_property(_test_libs GLOBAL PROPERTY BLENDER_TEST_LIBS) if(WIN32 OR APPLE) # Windows and macOS set target_link_options after target creation. + # + # Still need to ensure dependency between the test libraries and the blender_test binary, so that + # the latter one is re-linked when the test library is re-compiled. + list(APPEND TEST_LIBS ${_test_libs}) elseif(UNIX) list(APPEND TEST_LIBS "-Wl,--whole-archive" ${_test_libs} "-Wl,--no-whole-archive") else() -- 2.30.2