Skip to content

Extends support for arm64e to macOS & visionOS platforms #8837

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions Sources/SwiftBuildSupport/PIFBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -499,10 +499,10 @@ fileprivate final class PackagePIFBuilderDelegate: PackagePIFBuilder.BuildDelega
[]
}

var shouldiOSPackagesBuildForARM64e: Bool {
func shouldPackagesBuildForARM64e(platform: PackageModel.Platform) -> Bool {
false
}

var isPluginExecutionSandboxingDisabled: Bool {
false
}
Expand Down
20 changes: 15 additions & 5 deletions Sources/SwiftBuildSupport/PackagePIFBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ public final class PackagePIFBuilder {
/// Returns all *device family* IDs for all SDK variants.
func deviceFamilyIDs() -> Set<Int>

/// Have packages referenced by this workspace build for arm64e when building for iOS devices.
var shouldiOSPackagesBuildForARM64e: Bool { get }
/// Have packages referenced by this workspace build for *arm64e*
/// when building for iOS devices, macOS, and visionOS.
func shouldPackagesBuildForARM64e(platform: PackageModel.Platform) -> Bool

/// Is the sandbox disabled for plug-in execution? It should be `false` by default.
var isPluginExecutionSandboxingDisabled: Bool { get }
Expand Down Expand Up @@ -573,9 +574,18 @@ public final class PackagePIFBuilder {
settings[.CODE_SIGNING_REQUIRED] = "NO"
settings[.CODE_SIGN_IDENTITY] = ""

// If in a workspace that's set to build packages for arm64e, pass that along to Swift Build.
if self.delegate.shouldiOSPackagesBuildForARM64e {
settings.platformSpecificSettings[._iOSDevice]![.ARCHS] = ["arm64e"]
// If in a workspace that's set to build packages for _arm64e_, pass that along to Swift Build.
let arm64ePlatforms: [PackageModel.Platform] = [.iOS, .macOS, .visionOS]
for arm64ePlatform in arm64ePlatforms {
if self.delegate.shouldPackagesBuildForARM64e(platform: arm64ePlatform) {
let pifPlatform: ProjectModel.BuildSettings.Platform = switch arm64ePlatform {
case .iOS:
._iOSDevice
default:
.init(from: arm64ePlatform)
}
settings.platformSpecificSettings[pifPlatform]![.ARCHS] = ["arm64e"]
}
}

// Add the build settings that are specific to debug builds, and set those as the "Debug" configuration.
Expand Down