Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/scripts/swiftusd_ci_common/openusd_building.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ def get_openusd_build_flags(target):
"--ignore-homebrew", "--build-target", "native", openusd_build_dir("macOS"), file_prefix_map]

if target == "iOS":
return ["--imageio", "--alembic", "--no-python", "--ignore-homebrew",
return ["--embree", "--imageio", "--alembic", "--no-python", "--ignore-homebrew",
"--build-target", "iOS", "--no-build-apple-framework", openusd_build_dir("iOS"), file_prefix_map]

if target == "iOSSimulator":
return ["--imageio", "--alembic", "--no-python", "--ignore-homebrew",
return ["--embree", "--imageio", "--alembic", "--no-python", "--ignore-homebrew",
"--build-target", "iOSSimulator", "--no-build-apple-framework", openusd_build_dir("iOSSimulator"), file_prefix_map]

if target == "visionOS":
return ["--imageio", "--alembic", "--no-python", "--ignore-homebrew",
return ["--embree", "--imageio", "--alembic", "--no-python", "--ignore-homebrew",
"--build-target", "visionOS", "--no-build-apple-framework", openusd_build_dir("visionOS"), file_prefix_map]

if target == "visionOSSimulator":
return ["--imageio", "--alembic", "--no-python", "--ignore-homebrew",
return ["--embree", "--imageio", "--alembic", "--no-python", "--ignore-homebrew",
"--build-target", "visionOSSimulator", "--no-build-apple-framework", openusd_build_dir("visionOSSimulator"), file_prefix_map]

raise ValueError(f"Unknown target {target}")
1 change: 1 addition & 0 deletions SwiftUsd.docc/AboutThisRepo/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Changes to SwiftUsd
### TBD
Released TBD, based on OpenUSD TBD
- Add zero-copy `VtArray` reads via `withUnsafeBufferPointer(_:)` and single-copy construction from an `UnsafeBufferPointer`
- Add Embree to the default Swift Package for iOS, visionOS, and simulators

### 8.0.0
Released 2026-07-22, based on OpenUSD v26.08
Expand Down
4 changes: 4 additions & 0 deletions SwiftUsd.docc/TechnicalDetails/BuildingLocally.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ python3 build_scripts/build_usd.py \

cd ~/SwiftUsd/openusd-source
python3 build_scripts/build_usd.py \
--embree \
--imageio \
--alembic \
--no-python \
Expand All @@ -51,6 +52,7 @@ python3 build_scripts/build_usd.py \

cd ~/SwiftUsd/openusd-source
python3 build_scripts/build_usd.py \
--embree \
--imageio \
--alembic \
--no-python \
Expand All @@ -62,6 +64,7 @@ python3 build_scripts/build_usd.py \

cd ~/SwiftUsd/openusd-source
python3 build_scripts/build_usd.py \
--embree \
--imageio \
--alembic \
--no-python \
Expand All @@ -73,6 +76,7 @@ python3 build_scripts/build_usd.py \

cd ~/SwiftUsd/openusd-source
python3 build_scripts/build_usd.py \
--embree \
--imageio \
--alembic \
--no-python \
Expand Down
3 changes: 3 additions & 0 deletions SwiftUsd.docc/TechnicalDetails/ChangesToOpenUSD.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ These changes fix bugs or add features to Usd that aren't part of vanilla OpenUS
- Add support for usdValidation libraries when building for iOS, visionOS, or simulators:
- Modified: `build_scripts/build_usd.py`

- Cherry pick [https://github.com/PixarAnimationStudios/OpenUSD/pull/4166](https://github.com/PixarAnimationStudios/OpenUSD/pull/4166) to add support for Embree on iOS, visionOS, and simulators:
- Modified: `build_scripts/build_usd.py`

#### Swift-specific changes to OpenUSD before building
These changes work around Swift-specific issues in vanilla OpenUSD, add Swift-specific features, and work around issues in the Swift compiler.
- Header modularization fixes:
Expand Down
26 changes: 23 additions & 3 deletions openusd-patch.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
diff -Nura --exclude .git --exclude *.orig --exclude .DS_Store --exclude *.pyc /Users/maddyadams/OpenUSD/build_scripts/build_usd.py ./build_scripts/build_usd.py
--- /Users/maddyadams/OpenUSD/build_scripts/build_usd.py 2026-07-20 09:43:19
+++ ./build_scripts/build_usd.py 2026-07-20 10:06:34
@@ -2524,7 +2524,6 @@
--- /Users/maddyadams/OpenUSD/build_scripts/build_usd.py 2026-07-24 12:11:44
+++ ./build_scripts/build_usd.py 2026-07-27 10:36:40
@@ -1756,6 +1756,19 @@
"target_compile_options(embree PRIVATE -Wno-unused-but-set-variable)\n")],
multiLineMatches=True,
)
+ # Add iOS, visionOS support
+ PatchFile("CMakeLists.txt",
+ [('IF (APPLE AND CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND (CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" AND CMAKE_OSX_ARCHITECTURES STREQUAL "") OR ("arm64" IN_LIST CMAKE_OSX_ARCHITECTURES))',
+ 'IF (APPLE AND ((CMAKE_SYSTEM_NAME STREQUAL "Darwin") OR (CMAKE_SYSTEM_NAME STREQUAL "iOS") OR (CMAKE_SYSTEM_NAME STREQUAL "visionOS")) AND (CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" AND CMAKE_OSX_ARCHITECTURES STREQUAL "") OR ("arm64" IN_LIST CMAKE_OSX_ARCHITECTURES))'
+ )])
+ PatchFile("common/cmake/clang.cmake",
+ [(' SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.7") # makes sure code runs on older MacOSX versions\n',
+ ' IF (CMAKE_SYSTEM_NAME STREQUAL "Darwin")\n'
+ ' SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.7") # makes sure code runs on older MacOSX versions\n'
+ ' ENDIF()\n'
+ )],
+ multiLineMatches=True)
+
if context.targetUniversal:
extraArgs += [
'-DEMBREE_MAX_ISA=NEON',
@@ -2524,7 +2537,6 @@
not embedded and
not self.targetWasm)
self.buildUsdValidation = (args.build_usd_validation and
Expand Down
2 changes: 0 additions & 2 deletions scripts/make-swift-package/Sources/UsdFeatureFlags.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ extension FileSystemInfo {
/// or nil if the module name is available on embedded platforms
static func shortNameForFeatureUnavailableOnEmbeddedPlatforms(moduleName: String) -> String? {
switch moduleName {
case "SwiftUsd_PXR_ENABLE_EMBREE_SUPPORT": "Embree"
case "SwiftUsd_PXR_ENABLE_OPENIMAGEIO_SUPPORT": "OpenImageIO"
case "SwiftUsd_PXR_ENABLE_OPENVDB_SUPPORT": "OpenVDB"
default: nil
Expand All @@ -62,7 +61,6 @@ extension FileSystemInfo {
/// These flags use OR instead, because they're only available on certain platforms
static func prefersOrForMergingFeatureFlag(_ flag: String) -> Bool {
switch flag {
case "PXR_BUILD_EMBREE_PLUGIN": true
case "PXR_BUILD_OPENIMAGEIO_PLUGIN": true
case "PXR_ENABLE_OPENVDB_SUPPORT": true
default: false
Expand Down
Loading