[Bf-blender-cvs] [59b523c3c98] master: Fix build with USD, Clang and Linux
Stefano Bonicatti
noreply at git.blender.org
Fri Jun 19 15:53:07 CEST 2020
Commit: 59b523c3c98ece3c186354c3ae5300ae0a7c6b79
Author: Stefano Bonicatti
Date: Fri Jun 19 15:19:41 2020 +0200
Branches: master
https://developer.blender.org/rB59b523c3c98ece3c186354c3ae5300ae0a7c6b79
Fix build with USD, Clang and Linux
The important distinction for the linker flags is not between GCC and Clang,
but between the macOS and Linux.
Differential Revision: https://developer.blender.org/D8023
===================================================================
M source/blender/io/usd/CMakeLists.txt
===================================================================
diff --git a/source/blender/io/usd/CMakeLists.txt b/source/blender/io/usd/CMakeLists.txt
index fc4f45cdef8..19e16a5b328 100644
--- a/source/blender/io/usd/CMakeLists.txt
+++ b/source/blender/io/usd/CMakeLists.txt
@@ -100,10 +100,10 @@ endif()
# Source: https://github.com/PixarAnimationStudios/USD/blob/master/BUILDING.md#linking-whole-archives
if(WIN32)
target_link_libraries(bf_usd INTERFACE ${USD_LIBRARIES})
-elseif(CMAKE_COMPILER_IS_GNUCXX)
- target_link_libraries(bf_usd INTERFACE "-Wl,--whole-archive ${USD_LIBRARIES} -Wl,--no-whole-archive ${TBB_LIBRARIES}")
-elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+elseif(APPLE)
target_link_libraries(bf_usd INTERFACE -Wl,-force_load ${USD_LIBRARIES})
+elseif(UNIX)
+ target_link_libraries(bf_usd INTERFACE "-Wl,--whole-archive ${USD_LIBRARIES} -Wl,--no-whole-archive ${TBB_LIBRARIES}")
else()
message(FATAL_ERROR "Unknown how to link USD with your compiler ${CMAKE_CXX_COMPILER_ID}")
endif()
More information about the Bf-blender-cvs
mailing list