CMake/Deps: upgrade USD 20.05 → 21.02

USD version 21.02 includes two of the changes Blender used to patch in,
which have now been removed from `usd.diff`. Unfortunately 21.02
introduces another issue where LZ4 symbols are accidentally exported,
causing linker errors. Fortunately these symbols are only used for
resting, so I added a patch hunk that simply removes their `extern "C"`
declaration.

The LZ4 linker issue has been reported upstream at
https://github.com/PixarAnimationStudios/USD/issues/1447.

Reviewed By: sebbas, mont29

Differential Revision: https://developer.blender.org/D10367
This commit is contained in:
Sybren A. Stüvel 2021-02-09 10:38:41 +01:00
parent ebdf68a0bb
commit a923a34de1
Notes: blender-bot 2023-02-14 07:18:54 +01:00
Referenced by issue #85365, Libraries Changes for Blender 2.93
2 changed files with 28 additions and 34 deletions

View File

@ -297,9 +297,9 @@ set(EMBREE_VERSION 3.10.0)
set(EMBREE_URI https://github.com/embree/embree/archive/v${EMBREE_VERSION}.zip)
set(EMBREE_HASH 4bbe29e7eaa46417efc75fc5f1e8eb87)
set(USD_VERSION 20.05)
set(USD_VERSION 21.02)
set(USD_URI https://github.com/PixarAnimationStudios/USD/archive/v${USD_VERSION}.tar.gz)
set(USD_HASH 6d679e739e7f65725d9c029e37dda9fc)
set(USD_HASH 1dd1e2092d085ed393c1f7c450a4155a)
set(OIDN_VERSION 1.3.0)
set(OIDN_URI https://github.com/OpenImageDenoise/oidn/releases/download/v${OIDN_VERSION}/oidn-${OIDN_VERSION}.src.tar.gz)

View File

@ -26,36 +26,30 @@ diff -Naur external_usd_base/cmake/macros/Public.cmake external_usd/cmake/macros
endforeach()
foreach(lib ${PXR_OBJECT_LIBS})
set(objects "${objects};\$<TARGET_OBJECTS:${lib}>")
diff --git a/pxr/base/arch/align.h b/pxr/base/arch/align.h
index f3cabf4..ebc8a69 100644
--- a/pxr/base/arch/align.h
+++ b/pxr/base/arch/align.h
@@ -77,7 +77,11 @@ ArchAlignMemory(void *base)
/// The size of a CPU cache line on the current processor architecture in bytes.
///
/// \hideinitializer
+#if defined(ARCH_OS_DARWIN) && defined(ARCH_CPU_ARM)
+#define ARCH_CACHE_LINE_SIZE 128
+#else
#define ARCH_CACHE_LINE_SIZE 64
+#endif
diff -ru USD-20.11/pxr/base/tf/pxrLZ4/lz4.cpp external_usd/pxr/base/tf/pxrLZ4/lz4.cpp
--- USD-20.11/pxr/base/tf/pxrLZ4/lz4.cpp 2020-10-14 19:25:19.000000000 +0100
+++ external_usd/pxr/base/tf/pxrLZ4/lz4.cpp 2021-02-09 09:28:51.496190085 +0000
@@ -614,6 +614,15 @@
/*-************************************
* Internal Definitions used in Tests
**************************************/
+
+/*******************************************************************
+ * Disabled in Blender. The BLOSC library also exposes these
+ * functions, and this causes 'duplicate symbol' linker errors.
+ *
+ * This problem has been reported upstream at
+ * https://github.com/PixarAnimationStudios/USD/issues/1447
+ *
+ *******************************************************************
#if defined (__cplusplus)
extern "C" {
#endif
@@ -627,6 +636,7 @@
#if defined (__cplusplus)
}
#endif
+********************************************************************/
///@}
diff --git a/pxr/base/arch/math.h b/pxr/base/arch/math.h
index 3e66c37..64a052c 100644
--- a/pxr/base/arch/math.h
+++ b/pxr/base/arch/math.h
@@ -42,7 +42,7 @@ PXR_NAMESPACE_OPEN_SCOPE
/// \addtogroup group_arch_Math
///@{
-#if defined (ARCH_CPU_INTEL) || defined(doxygen)
+#if defined (ARCH_CPU_INTEL) || defined(ARCH_CPU_ARM) || defined(doxygen)
/// This is the smallest value e such that 1+e^2 == 1, using floats.
/// True for all IEEE754 chipsets.
/*-******************************
* Compression functions