Skip to content

Commit eba9198

Browse files
Default to enabling host toolchain on macOS
- It can still be disabled, but most people would want to include it when just building a Swift SDK with minimal params.
1 parent df46d2f commit eba9198

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Sources/GeneratorCLI/GeneratorCLI.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ extension GeneratorCLI {
125125
but requires exactly the same version of the swift.org toolchain to be installed for it to work.
126126
"""
127127
)
128-
var hostToolchain: Bool = false
128+
var hostToolchain: Bool = hostToolchainDefault
129129

130130
@Option(
131131
help: """
@@ -154,6 +154,15 @@ extension GeneratorCLI {
154154
@Option(help: "Deprecated. Use `--target` instead")
155155
var targetArch: Triple.Arch? = nil
156156

157+
/// Default to adding host toolchain when building on macOS
158+
static var hostToolchainDefault: Bool {
159+
#if os(macOS)
160+
true
161+
#else
162+
false
163+
#endif
164+
}
165+
157166
func deriveHostTriple() throws -> Triple {
158167
if let host {
159168
return host

0 commit comments

Comments
 (0)