From c82b8c5944d85a24fcb1b6552e970accb4628c9d Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 31 Jan 2020 12:51:35 +0100 Subject: Fix tests failing on AMD Ryzen, due TBB initialization order issue Similar fix as the one we did for the blender executable, see T72015. --- build_files/cmake/Modules/GTestTesting.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'build_files/cmake/Modules') diff --git a/build_files/cmake/Modules/GTestTesting.cmake b/build_files/cmake/Modules/GTestTesting.cmake index 30b10ae5980..c9f62906ae0 100644 --- a/build_files/cmake/Modules/GTestTesting.cmake +++ b/build_files/cmake/Modules/GTestTesting.cmake @@ -40,9 +40,14 @@ macro(BLENDER_SRC_GTEST_EX) add_executable(${TARGET_NAME} ${ARG_SRC} ${MANIFEST}) target_include_directories(${TARGET_NAME} PUBLIC "${TEST_INC}") target_include_directories(${TARGET_NAME} SYSTEM PUBLIC "${TEST_INC_SYS}") + target_link_libraries(${TARGET_NAME} ${ARG_EXTRA_LIBS} ${PLATFORM_LINKLIBS}) + if(WITH_TBB) + # Force TBB libraries to be in front of MKL (part of OpenImageDenoise), so + # that it is initialized before MKL and static library initialization order + # issues are avoided. + target_link_libraries(${TARGET_NAME} ${TBB_LIBRARIES}) + endif() target_link_libraries(${TARGET_NAME} - ${ARG_EXTRA_LIBS} - ${PLATFORM_LINKLIBS} bf_testing_main bf_intern_eigen bf_intern_guardedalloc -- cgit v1.2.3