Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2020-07-31 15:14:56 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-07-31 15:15:42 +0300
commit5628aaeee1b678c58c67afbbe7d91565f45618a0 (patch)
tree8b1184015809844f71e414c042e2942c18c2282f /tests/gtests
parent3785dc59d10025dbbfcc5192abda64d530a143ea (diff)
Fix build of blender_test runner on macOS
Diffstat (limited to 'tests/gtests')
-rw-r--r--tests/gtests/runner/CMakeLists.txt13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/gtests/runner/CMakeLists.txt b/tests/gtests/runner/CMakeLists.txt
index 954fcf914a9..87cc124bda8 100644
--- a/tests/gtests/runner/CMakeLists.txt
+++ b/tests/gtests/runner/CMakeLists.txt
@@ -35,10 +35,8 @@ endif()
# Test libraries need to be linked "whole archive", because they're not
# directly referenced from other code.
get_property(_test_libs GLOBAL PROPERTY BLENDER_TEST_LIBS)
-if(WIN32)
- # Win32 is set using target_link_options after target creation.
-elseif(APPLE)
- list(APPEND TEST_LIBS "-Wl,-force_load" ${_test_libs})
+if(WIN32 OR APPLE)
+ # Windows and macOS set target_link_options after target creation.
elseif(UNIX)
list(APPEND TEST_LIBS "-Wl,--whole-archive" ${_test_libs} "-Wl,--no-whole-archive")
else()
@@ -63,6 +61,13 @@ if(WIN32)
target_link_libraries(blender_test ${_lib})
target_link_options(blender_test PRIVATE /wholearchive:$<TARGET_FILE:${_lib}>)
endforeach()
+elseif(APPLE)
+ foreach(_lib ${_test_libs})
+ # We need -force_load for every test library and target_link_libraries will
+ # deduplicate it. So explicitly set as linker option for every test lib.
+ target_link_libraries(blender_test ${_lib})
+ target_link_options(blender_test PRIVATE "LINKER:-force_load,$<TARGET_FILE:${_lib}>")
+ endforeach()
endif()
unset(_test_libs)