From d33960aead7c79cecd2e9681d30d7ea44f3f6981 Mon Sep 17 00:00:00 2001 From: Ray molenkamp Date: Sat, 11 Feb 2023 19:48:47 +0100 Subject: [PATCH] Cleanup: remove whole-archive linking for USD Since USD is no longer statically linked these linker tricks are no longer needed. Co-authored-by: Ray Molenkamp Pull Request #104627 --- source/blender/io/usd/CMakeLists.txt | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/source/blender/io/usd/CMakeLists.txt b/source/blender/io/usd/CMakeLists.txt index b123eb251ab..ac9e22ee631 100644 --- a/source/blender/io/usd/CMakeLists.txt +++ b/source/blender/io/usd/CMakeLists.txt @@ -127,6 +127,8 @@ list(APPEND LIB ${BOOST_LIBRARIES} ${BOOST_PYTHON_LIBRARIES} ${PYTHON_LIBRARIES} + ${USD_LIBRARIES} + ${TBB_LIBRARIES} ) if(WITH_OPENVDB) @@ -141,27 +143,6 @@ endif() blender_add_lib(bf_usd "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") -if(WIN32) - set_property(TARGET bf_usd APPEND_STRING PROPERTY INTERFACE_LINK_OPTIONS "$<$:/WHOLEARCHIVE:${USD_DEBUG_LIB}>") - set_property(TARGET bf_usd APPEND_STRING PROPERTY INTERFACE_LINK_OPTIONS "$<$:/WHOLEARCHIVE:${USD_RELEASE_LIB}>") - set_property(TARGET bf_usd APPEND_STRING PROPERTY INTERFACE_LINK_OPTIONS "$<$:/WHOLEARCHIVE:${USD_RELEASE_LIB}>") - set_property(TARGET bf_usd APPEND_STRING PROPERTY INTERFACE_LINK_OPTIONS "$<$:/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 INTERFACE ${USD_LIBRARIES}) -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() - -target_link_libraries(bf_usd INTERFACE ${TBB_LIBRARIES}) - if(WITH_GTESTS) set(TEST_SRC tests/usd_stage_creation_test.cc