[Bf-blender-cvs] [c84f9de2a3b] tmp_lib_update_32: deps: fix building USD imaging on windows

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


Commit: c84f9de2a3b82f1d41f3e5c208db3eba48f2748b
Author: Ray Molenkamp
Date:   Tue Mar 22 07:23:48 2022 -0600
Branches: tmp_lib_update_32
https://developer.blender.org/rBc84f9de2a3b82f1d41f3e5c208db3eba48f2748b

deps: fix building USD imaging on windows

Needs the static OIIO/OSL defines to properly
link

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

M	build_files/build_environment/cmake/usd.cmake

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

diff --git a/build_files/build_environment/cmake/usd.cmake b/build_files/build_environment/cmake/usd.cmake
index 8bffc402cc4..af766266cc7 100644
--- a/build_files/build_environment/cmake/usd.cmake
+++ b/build_files/build_environment/cmake/usd.cmake
@@ -1,16 +1,16 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 
-if(WIN32 AND BUILD_MODE STREQUAL Debug)
-  # There is something wonky in the ctor of the USD Trace class
-  # It will gobble up all ram and derefs a nullptr once it runs
-  # out...so...thats fun... I lack the time to debug this currently
-  # so disabling the trace will have to suffice.
-  set(USD_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DTRACE_DISABLE")
-  # USD does not look for debug libs, nor does it link them
-  # when building static, so this is just to keep find_package happy
-  # if we ever link dynamically on windows util will need to be linked.
+if(WIN32)
+  # OIIO and OSL are statically linked for us, but USD doesn't know
+  set(USD_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DOIIO_STATIC_DEFINE /DOSL_STATIC_DEFINE")
+  if(BUILD_MODE STREQUAL Debug)
+    # USD does not look for debug libs, nor does it link them
+    # when building static, so this is just to keep find_package happy
+    # if we ever link dynamically on windows util will need to be linked as well.
+    set(USD_OIIO_CMAKE_DEFINES "-DOIIO_LIBRARIES=${LIBDIR}/openimageio/lib/OpenImageIO_d${LIBEXT}")
+  endif()
   set(USD_PLATFORM_FLAGS
-    -DOIIO_LIBRARIES=${LIBDIR}/openimageio/lib/OpenImageIO_d${LIBEXT}
+    ${USD_OIIO_CMAKE_DEFINES}
     -DCMAKE_CXX_FLAGS=${USD_CXX_FLAGS}
   )
 endif()



More information about the Bf-blender-cvs mailing list