[Bf-blender-cvs] [fdf1a05b94b] tmp_lib_update_32: deps: Fix USD build/test errors

Ray Molenkamp noreply at git.blender.org
Tue Mar 22 21:14:24 CET 2022


Commit: fdf1a05b94bffceb832462478c9f7525fe1722b7
Author: Ray Molenkamp
Date:   Tue Mar 22 14:14:14 2022 -0600
Branches: tmp_lib_update_32
https://developer.blender.org/rBfdf1a05b94bffceb832462478c9f7525fe1722b7

deps: Fix USD build/test errors

===================================================================

M	build_files/build_environment/cmake/usd.cmake
M	extern/mantaflow/CMakeLists.txt

===================================================================

diff --git a/build_files/build_environment/cmake/usd.cmake b/build_files/build_environment/cmake/usd.cmake
index a1c234f61a9..3b5f9d21d95 100644
--- a/build_files/build_environment/cmake/usd.cmake
+++ b/build_files/build_environment/cmake/usd.cmake
@@ -70,39 +70,33 @@ add_dependencies(
   external_usd
   external_tbb
   external_boost
+  external_openimageio
+  external_opensubdiv
+  external_osl
 )
 
 # Since USD 21.11 the libraries are prefixed with "usd_", i.e. "libusd_m.a" became "libusd_usd_m.a".
 # See https://github.com/PixarAnimationStudios/USD/blob/release/CHANGELOG.md#2111---2021-11-01
-if (USD_VERSION VERSION_LESS 21.11)
-  set(PXR_LIB_PREFIX "")
-else()
-  set(PXR_LIB_PREFIX "usd_")
+if(NOT WIN32)
+  if (USD_VERSION VERSION_LESS 21.11)
+    set(PXR_LIB_PREFIX "")
+  else()
+    set(PXR_LIB_PREFIX "usd_")
+  endif()
 endif()
 
 if(WIN32)
-  # USD currently demands python be available at build time
-  # and then proceeds not to use it, but still checks that the
-  # version of the interpreter it is not going to use is atleast 2.7
-  # so we need this dep currently since there is no system python
-  # on windows.
-  add_dependencies(
-    external_usd
-    external_openimageio
-    external_opensubdiv
-    external_osl
-  )
   if(BUILD_MODE STREQUAL Release)
     ExternalProject_Add_Step(external_usd after_install
       COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/usd/ ${HARVEST_TARGET}/usd
-      COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/usd/src/external_usd-build/pxr/Release/${PXR_LIB_PREFIX}usd_m.lib ${HARVEST_TARGET}/usd/lib/lib${PXR_LIB_PREFIX}usd_m.lib
+      COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/usd/src/external_usd-build/pxr/Release/usd_usd_m.lib ${HARVEST_TARGET}/usd/lib/usd_usd_m.lib
       DEPENDEES install
     )
   endif()
   if(BUILD_MODE STREQUAL Debug)
     ExternalProject_Add_Step(external_usd after_install
       COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/usd/lib ${HARVEST_TARGET}/usd/lib
-      COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/usd/src/external_usd-build/pxr/Debug/${PXR_LIB_PREFIX}usd_m_d.lib ${HARVEST_TARGET}/usd/lib/lib${PXR_LIB_PREFIX}usd_m_d.lib
+      COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/usd/src/external_usd-build/pxr/Debug/usd_usd_m_d.lib ${HARVEST_TARGET}/usd/lib/usd_usd_m_d.lib
       DEPENDEES install
     )
   endif()
diff --git a/extern/mantaflow/CMakeLists.txt b/extern/mantaflow/CMakeLists.txt
index c9e2b54ef18..7066ab9750d 100644
--- a/extern/mantaflow/CMakeLists.txt
+++ b/extern/mantaflow/CMakeLists.txt
@@ -259,3 +259,10 @@ set(LIB
 )
 
 blender_add_lib(extern_mantaflow "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
+
+# The VDB libs above are only added to as INTERFACE libs by blender_add_lib,
+# meaning extern_mantaflow itself actually does not have a dependency on the
+# openvdb libraries, and CMAKE is free to link the vdb libs before 
+# extern_mantaflow causing linker errors on linux. By explicitly declaring
+# a dependency here, cmake will do the right thing.
+target_link_libraries(extern_mantaflow PRIVATE ${OPENVDB_LIBRARIES})



More information about the Bf-blender-cvs mailing list