diff --git a/Scripts/create-xcframework.sh b/Scripts/create-xcframework.sh index 5d72cc45..258fb21f 100755 --- a/Scripts/create-xcframework.sh +++ b/Scripts/create-xcframework.sh @@ -25,12 +25,28 @@ xcodebuild archive \ -archivePath "$BUILD_DIR/Archives/Compute-iOS-Simulator.xcarchive" \ ENABLE_USER_SCRIPT_SANDBOXING=NO +xcodebuild archive \ + -project Xcode/Compute.xcodeproj \ + -scheme Compute \ + -destination "generic/platform=visionOS" \ + -archivePath "$BUILD_DIR/Archives/Compute-visionOS.xcarchive" \ + ENABLE_USER_SCRIPT_SANDBOXING=NO + +xcodebuild archive \ + -project Xcode/Compute.xcodeproj \ + -scheme Compute \ + -destination "generic/platform=visionOS Simulator" \ + -archivePath "$BUILD_DIR/Archives/Compute-visionOS-Simulator.xcarchive" \ + ENABLE_USER_SCRIPT_SANDBOXING=NO + rm -rf "$BUILD_DIR/Frameworks/Compute.xcframework" xcodebuild -create-xcframework \ -archive "$BUILD_DIR/Archives/Compute-macOS.xcarchive" -framework Compute.framework \ -archive "$BUILD_DIR/Archives/Compute-iOS.xcarchive" -framework Compute.framework \ -archive "$BUILD_DIR/Archives/Compute-iOS-Simulator.xcarchive" -framework Compute.framework \ + -archive "$BUILD_DIR/Archives/Compute-visionOS.xcarchive" -framework Compute.framework \ + -archive "$BUILD_DIR/Archives/Compute-visionOS-Simulator.xcarchive" -framework Compute.framework \ -output "$BUILD_DIR/Frameworks/Compute.xcframework" # Post-process swiftinterface files to replace ComputeCxx references with Compute diff --git a/Sources/Compute/Attribute/AttributeType.swift b/Sources/Compute/Attribute/AttributeType.swift index 36ce869d..c8542791 100644 --- a/Sources/Compute/Attribute/AttributeType.swift +++ b/Sources/Compute/Attribute/AttributeType.swift @@ -32,7 +32,7 @@ extension _AttributeType { vtable.pointee.self_destroy = { attributeType, body in attributeType.pointee.attributeBody._destroySelf(body) } - #if os(iOS) || os(macOS) + #if canImport(Darwin) vtable.pointee.self_description = { attributeType, body in let description: String if let selfType = attributeType.pointee.self_id.type diff --git a/Sources/Compute/Runtime/Metadata.swift b/Sources/Compute/Runtime/Metadata.swift index 76ff0af7..da651246 100644 --- a/Sources/Compute/Runtime/Metadata.swift +++ b/Sources/Compute/Runtime/Metadata.swift @@ -45,7 +45,7 @@ extension Metadata { extension Metadata: @retroactive CustomStringConvertible { public var description: String { - #if os(iOS) || os(macOS) + #if canImport(Darwin) return __IAGTypeDescription(self) as String #else return String(__IAGTypeCopyDescription(self))