To be shared with Cycles standalone that will get USD support.
Details
Details
Diff Detail
Diff Detail
- Repository
- rB Blender
Event Timeline
| build_files/cmake/Modules/FindUSD.cmake | ||
|---|---|---|
| 63 | This likely won't do the trick for windows, the magic on windows is happening just above the chunk you took out in source/blender/io/usd/CMakeLists.txt | |
Comment Actions
i'd probably try something like this near the end of FindUSD.cmake (done in the editor here, not tested, likely contains a typo or two)
add_library(USD::USD INTERFACE)
if(WIN32)
set_property(TARGET USD::USD APPEND_STRING PROPERTY INTERFACE_LINK_OPTIONS "$<$<CONFIG:Debug>:/WHOLEARCHIVE:${USD_DEBUG_LIB}>")
set_property(TARGET USD::USD APPEND_STRING PROPERTY INTERFACE_LINK_OPTIONS "$<$<CONFIG:Release>:/WHOLEARCHIVE:${USD_RELEASE_LIB}>")
set_property(TARGET USD::USD APPEND_STRING PROPERTY INTERFACE_LINK_OPTIONS "$<$<CONFIG:RelWithDebInfo>:/WHOLEARCHIVE:${USD_RELEASE_LIB}>")
set_property(TARGET USD::USD APPEND_STRING PROPERTY INTERFACE_LINK_OPTIONS "$<$<CONFIG:MinSizeRel>:/WHOLEARCHIVE:${USD_RELEASE_LIB}>")
endif()
# Source: https://github.com/PixarAnimationStudios/USD/blob/master/BUILDING.md#linking-whole-archives
if(WIN32)
target_link_libraries(USD::USD INTERFACE ${USD_LIBRARIES})
elseif(APPLE)
target_link_libraries(USD::USD INTERFACE -Wl,-force_load ${USD_LIBRARIES})
elseif(UNIX)
target_link_libraries(USD::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()and linking against USD::USD in the client code rather than ${USD_LIBRARIES}
after thought: maybe BLENDER::USD ? we really haven't gotten any deps as modern targets yet so i'm kinda making it up as we go.