Skip to content

Add visionOS slices to the XCFramework - #83

Open
Kyle-Ye wants to merge 1 commit into
jcmosc:mainfrom
OpenSwiftUIProject:feature/visionos-xcframework
Open

Kyle-Ye wants to merge 1 commit into
jcmosc:mainfrom
OpenSwiftUIProject:feature/visionos-xcframework

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

The release XCFramework only contains macOS, iOS, and iOS Simulator slices, so projects that depend on the Compute binary cannot build for visionOS. The Xcode project already supports xros and xrsimulator.

Archive Compute for visionOS and the visionOS Simulator in Scripts/create-xcframework.sh, and include both archives in Compute.xcframework.

The C headers select the attribute vtable and type description declarations with TARGET_OS_MAC, which is true on every Apple platform. The Swift code used os(iOS) || os(macOS) for the same branches, so a visionOS build used the non-Darwin branch and failed to compile. Use canImport(Darwin), as Graph.swift already does. The behavior on macOS and iOS does not change.

Validation

Archive Compute for visionOS and the visionOS Simulator and include both
in Compute.xcframework.

Use canImport(Darwin) for the attribute vtable and type description
branches in Swift. The C headers select these declarations with
TARGET_OS_MAC, so visionOS must use the Darwin branch as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant