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:
authorSergey Sharybin <sergey.vfx@gmail.com>2020-01-24 14:47:35 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2020-01-24 14:47:35 +0300
commit18343c230d2c447f61fb60994b107f6a1adc01e7 (patch)
tree14c69008df14feb2b4179cc5e5fac5cf86316e1c /source/blender/usd
parent71d53ab4654c3abb9bd548b324f8c9ca34250a9b (diff)
Fix/workaround initialization order of static TBB/MKL
Was caused by recent refactor of dependencies in 517870a4a11f. While there is no fully reliable solution to this issue other than making TBB a dynamic library dependency (as documentation tells us to do), there seems to be simple workaround which doesn't require deeper changed in build process and packaging. Tested on Brecht's computer who managed to reproduce the issue on Linux (T72015#857423).
Diffstat (limited to 'source/blender/usd')
-rw-r--r--source/blender/usd/CMakeLists.txt31
1 files changed, 13 insertions, 18 deletions
diff --git a/source/blender/usd/CMakeLists.txt b/source/blender/usd/CMakeLists.txt
index 1d72593f829..f4cf53e573f 100644
--- a/source/blender/usd/CMakeLists.txt
+++ b/source/blender/usd/CMakeLists.txt
@@ -78,29 +78,11 @@ set(LIB
bf_blenlib
)
-# Source: https://github.com/PixarAnimationStudios/USD/blob/master/BUILDING.md#linking-whole-archives
-if(WIN32)
- list(APPEND LIB
- ${USD_LIBRARIES}
- )
-elseif(CMAKE_COMPILER_IS_GNUCXX)
- list(APPEND LIB
- -Wl,--whole-archive ${USD_LIBRARIES} -Wl,--no-whole-archive
- )
-elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
- list(APPEND LIB
- -Wl,-force_load ${USD_LIBRARIES}
- )
-else()
- message(FATAL_ERROR "Unknown how to link USD with your compiler ${CMAKE_CXX_COMPILER_ID}")
-endif()
-
list(APPEND LIB
${BOOST_LIBRARIES}
)
list(APPEND LIB
- ${TBB_LIBRARIES}
)
blender_add_lib(bf_usd "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
@@ -111,3 +93,16 @@ if(WIN32)
set_property(TARGET bf_usd APPEND_STRING PROPERTY LINK_FLAGS_RELWITHDEBINFO " /WHOLEARCHIVE:${USD_RELEASE_LIB}")
set_property(TARGET bf_usd APPEND_STRING PROPERTY LINK_FLAGS_MINSIZEREL " /WHOLEARCHIVE:${USD_RELEASE_LIB}")
endif()
+
+# Source: https://github.com/PixarAnimationStudios/USD/blob/master/BUILDING.md#linking-whole-archives
+if(WIN32)
+ target_link_libraries(bf_usd ${USD_LIBRARIES})
+elseif(CMAKE_COMPILER_IS_GNUCXX)
+ target_link_libraries(bf_usd "-Wl,--whole-archive ${USD_LIBRARIES} -Wl,--no-whole-archive ${TBB_LIBRARIES}")
+elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+ target_link_libraries(bf_usd -Wl,-force_load ${USD_LIBRARIES})
+else()
+ message(FATAL_ERROR "Unknown how to link USD with your compiler ${CMAKE_CXX_COMPILER_ID}")
+endif()
+
+target_link_libraries(bf_usd ${TBB_LIBRARIES})