Skip to content

Commit 536b8d2

Browse files
authored
Allow use of swiftbuild backend when multi-arch builds are explicitly requested (#9001)
Previously, these would fallback to --build-system Xcode, which isn't necessary since Swift Build can build universal binaries
1 parent 943ca4b commit 536b8d2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Sources/CoreCommands/Options.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,13 @@ public struct BuildOptions: ParsableArguments {
542542
public var debugInfoFormat: DebugInfoFormat = .dwarf
543543

544544
public var buildSystem: BuildSystemProvider.Kind {
545-
// Force the Xcode build system if we want to build more than one arch.
546-
return self.architectures.count > 1 ? .xcode : self._buildSystem
545+
switch self._buildSystem {
546+
case .swiftbuild, .xcode:
547+
return self._buildSystem
548+
case .native:
549+
// Maintain legacy behavior and force use of the Xcode build system if we want to build more than one arch.
550+
return self.architectures.count > 1 ? .xcode : .native
551+
}
547552
}
548553

549554
/// Whether to enable test discovery on platforms without Objective-C runtime.

0 commit comments

Comments
 (0)