diff options
Diffstat (limited to 'build_files')
-rw-r--r-- | build_files/build_environment/cmake/harvest.cmake | 6 | ||||
-rw-r--r-- | build_files/build_environment/patches/usd.diff | 28 | ||||
-rw-r--r-- | build_files/cmake/macros.cmake | 8 | ||||
-rw-r--r-- | build_files/cmake/platform/platform_win32.cmake | 6 |
4 files changed, 36 insertions, 12 deletions
diff --git a/build_files/build_environment/cmake/harvest.cmake b/build_files/build_environment/cmake/harvest.cmake index 5b5c254b150..5fb62e330af 100644 --- a/build_files/build_environment/cmake/harvest.cmake +++ b/build_files/build_environment/cmake/harvest.cmake @@ -62,14 +62,8 @@ if(BUILD_MODE STREQUAL Debug) # OpenImageIO COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_d.lib && ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO_Util.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_Util_d.lib && - # python - ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/python/ ${HARVEST_TARGET}/python/ && # hdf5 ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/hdf5/lib ${HARVEST_TARGET}/hdf5/lib && - # numpy - ${CMAKE_COMMAND} -E copy ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}d.tar.gz ${HARVEST_TARGET}/Release/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}d.tar.gz && - # python - ${CMAKE_COMMAND} -E copy ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_d.tar.gz ${HARVEST_TARGET}/Release/python${PYTHON_SHORT_VERSION_NO_DOTS}_d.tar.gz DEPENDS Package_Python ) endif() diff --git a/build_files/build_environment/patches/usd.diff b/build_files/build_environment/patches/usd.diff index 8afd9700e59..6302f13796b 100644 --- a/build_files/build_environment/patches/usd.diff +++ b/build_files/build_environment/patches/usd.diff @@ -109,3 +109,31 @@ diff -x .git -ur usd.orig/pxr/usd/CMakeLists.txt external_usd/pxr/usd/CMakeLists +else() + message(STATUS "Skipping commandline tools because PXR_BUILD_USD_TOOLS=OFF") +endif() +diff -Naur external_usd_orig/pxr/base/lib/tf/preprocessorUtils.h external_usd/pxr/base/lib/tf/preprocessorUtils.h +--- external_usd_orig/pxr/base/lib/tf/preprocessorUtils.h 2019-10-24 14:39:53 -0600 ++++ external_usd/pxr/base/lib/tf/preprocessorUtils.h 2020-01-14 09:30:18 -0700 +@@ -189,7 +189,7 @@ + /// Exapnds to 1 if the argument is a tuple, and 0 otherwise. + /// \ingroup group_tf_Preprocessor + /// \hideinitializer +-#if defined(ARCH_OS_WINDOWS) ++#if defined(ARCH_COMPILER_MSVC) + #define TF_PP_IS_TUPLE(sequence) \ + BOOST_VMD_IS_TUPLE(sequence) + #else +diff -Naur external_usd_base/cmake/macros/Public.cmake external_usd/cmake/macros/Public.cmake +--- external_usd_base/cmake/macros/Public.cmake 2019-10-24 14:39:53 -0600 ++++ external_usd/cmake/macros/Public.cmake 2020-01-11 13:33:29 -0700 +@@ -996,6 +996,12 @@ + foreach(lib ${PXR_OBJECT_LIBS}) + string(TOUPPER ${lib} uppercaseName) + list(APPEND exports "${uppercaseName}_EXPORTS=1") ++ # When building for blender, we do NOT want to export all symbols on windows. ++ # This is a dirty hack, but USD makes it impossible to do the right thing ++ # with the default options exposed. ++ if (WIN32) ++ list(APPEND exports "PXR_STATIC=1") ++ endif() + endforeach() + foreach(lib ${PXR_OBJECT_LIBS}) + set(objects "${objects};\$<TARGET_OBJECTS:${lib}>") diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 3fe9ae90a79..23ed5b6cbfb 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -481,10 +481,10 @@ function(setup_liblinks # Source: https://github.com/PixarAnimationStudios/USD/blob/master/BUILDING.md#linking-whole-archives if(WIN32) target_link_libraries(${target} ${USD_LIBRARIES}) - set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS_DEBUG " /WHOLEARCHIVE:libusd_m_d.lib") - set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS_RELEASE " /WHOLEARCHIVE:libusd_m.lib") - set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS_RELWITHDEBINFO " /WHOLEARCHIVE:libusd_m.lib") - set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS_MINSIZEREL " /WHOLEARCHIVE:libusd_m.lib") + set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS_DEBUG " /WHOLEARCHIVE:${USD_DEBUG_LIB}") + set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS_RELEASE " /WHOLEARCHIVE:${USD_RELEASE_LIB}") + set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS_RELWITHDEBINFO " /WHOLEARCHIVE:${USD_RELEASE_LIB}") + set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS_MINSIZEREL " /WHOLEARCHIVE:${USD_RELEASE_LIB}") elseif(CMAKE_COMPILER_IS_GNUCXX) target_link_libraries(${target} -Wl,--whole-archive ${USD_LIBRARIES} -Wl,--no-whole-archive) elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake index c3d9b551926..b57fe5c9cda 100644 --- a/build_files/cmake/platform/platform_win32.cmake +++ b/build_files/cmake/platform/platform_win32.cmake @@ -660,9 +660,11 @@ if(WITH_USD) if(NOT USD_FOUND) set(USD_FOUND ON) set(USD_INCLUDE_DIRS ${LIBDIR}/usd/include) + set(USD_RELEASE_LIB ${LIBDIR}/usd/lib/libusd_m.lib) + set(USD_DEBUG_LIB ${LIBDIR}/usd/lib/libusd_m_d.lib) set(USD_LIBRARIES - debug ${LIBDIR}/usd/lib/libusd_m_d.lib - optimized ${LIBDIR}/usd/lib/libusd_m.lib + debug ${USD_DEBUG_LIB} + optimized ${USD_RELEASE_LIB} ) endif() endif() |