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.

Pull Request: https://projects.blender.org/blender/blender/pulls/106051
This commit is contained in:
Sergey Sharybin
2023-03-24 14:11:46 +01:00
committed by Sergey Sharybin
parent cef82a1d39
commit 18a15bafe8

View File

@@ -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()