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:
-rw-r--r--source/blender/usd/CMakeLists.txt31
-rw-r--r--source/creator/CMakeLists.txt8
2 files changed, 21 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})
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index d2af282f9a4..82c45b4fe64 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -38,6 +38,14 @@ blender_include_dirs(
)
set(LIB
+ # This forces TBB libraries to be in front of MKL (which is a part of OpenImageDenoise).
+ #
+ # The need of this comes to need to ensure static libraries initialization order, making it
+ # so TBB is initialized prior to MKL (or any other dpeendnecy).
+ #
+ # This isn't fully robust but seems to work.
+ ${TBB_LIBRARIES}
+
bf_windowmanager
)