File tree 1 file changed +10
-2
lines changed 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -507,8 +507,16 @@ public final class ToolchainRegistry: @unchecked Sendable {
507
507
/// Look up the toolchain with the given identifier.
508
508
public func lookup( _ identifier: String ) -> Toolchain ? {
509
509
let lowercasedIdentifier = identifier. lowercased ( )
510
- let identifier = [ " default " , " xcode " ] . contains ( lowercasedIdentifier) ? ToolchainRegistry . defaultToolchainIdentifier : identifier
511
- return toolchainsByIdentifier [ identifier] ?? toolchainsByAlias [ lowercasedIdentifier]
510
+ if [ " default " , " xcode " ] . contains ( lowercasedIdentifier) {
511
+ #if canImport(Darwin)
512
+ return toolchainsByIdentifier [ ToolchainRegistry . defaultToolchainIdentifier] ?? toolchainsByAlias [ lowercasedIdentifier]
513
+ #else
514
+ // On non-Darwin, assume if there is only one registered toolchain, it is the default.
515
+ return toolchainsByIdentifier [ ToolchainRegistry . defaultToolchainIdentifier] ?? toolchainsByAlias [ lowercasedIdentifier] ?? toolchainsByIdentifier. values. only
516
+ #endif
517
+ } else {
518
+ return toolchainsByIdentifier [ identifier] ?? toolchainsByAlias [ lowercasedIdentifier]
519
+ }
512
520
}
513
521
514
522
public var defaultToolchain : Toolchain ? {
You can’t perform that action at this time.
0 commit comments