Skip to content

Commit 9cb08dd

Browse files
Make some small corrections in the FreeBSD SDK generator (#241)
- Change some shared options' help text to not be Linux-specific - Note that the default FreeBSD target matches the host arch, not fixed to `x86_64` - Spell version option as `--freebsd-version`, not `--free-bsd-version` - Remove `--from-swift-toolchain`, the `--target-swift-package-path` option already existed for this purpose - Emit an error if `--host-swift-package-path` is given, since this currently has no effect
1 parent 7c4c479 commit 9cb08dd

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

Sources/GeneratorCLI/GeneratorCLI.swift

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ extension GeneratorCLI {
9090

9191
@Option(
9292
help: """
93-
Name of the SDK bundle. Defaults to a string composed of Swift version, Linux distribution, Linux release \
93+
Name of the SDK bundle. Defaults to a string composed of Swift version, target OS release/version \
9494
and target CPU architecture.
9595
"""
9696
)
@@ -160,7 +160,8 @@ extension GeneratorCLI {
160160
@Option(
161161
help: """
162162
The target arch of the bundle. The default depends on a recipe used for SDK generation. \
163-
If this is passed, the target triple will default to `<target-arch>-unknown-linux-gnu`. \
163+
If this is passed, the target triple will default to an appropriate value for the target \
164+
platform, with its arch component set to this value. \
164165
Use the `--target` param to pass the full target triple if needed.
165166
"""
166167
)
@@ -323,22 +324,15 @@ extension GeneratorCLI {
323324
commandName: "make-freebsd-sdk",
324325
abstract: "Generate a Swift SDK bundle for FreeBSD.",
325326
discussion: """
326-
The default `--target` triple is FreeBSD for x86_64
327+
The default `--target` triple is FreeBSD with the same CPU architecture with host triple
327328
"""
328329
)
329330

330331
@OptionGroup
331332
var generatorOptions: GeneratorOptions
332333

333334
@Option(
334-
help: """
335-
Swift toolchain for FreeBSD from which to copy the Swift libraries. \
336-
This must match the architecture of the target triple.
337-
"""
338-
)
339-
var fromSwiftToolchain: String? = nil
340-
341-
@Option(
335+
name: .customLong("freebsd-version"),
342336
help: """
343337
Version of FreeBSD to use as a target platform. Example: 14.3
344338
"""
@@ -377,8 +371,12 @@ extension GeneratorCLI {
377371
let hostTriples = try self.generatorOptions.deriveHostTriples()
378372
let targetTriple = try self.deriveTargetTriple(hostTriples: hostTriples, freeBSDVersion: self.freeBSDVersion)
379373

374+
if self.generatorOptions.hostSwiftPackagePath != nil {
375+
throw StringError("This tool does not support embedding host-specific toolchains into FreeBSD SDKs")
376+
}
377+
380378
let sourceSwiftToolchain: FilePath?
381-
if let fromSwiftToolchain {
379+
if let fromSwiftToolchain = self.generatorOptions.targetSwiftPackagePath {
382380
sourceSwiftToolchain = .init(fromSwiftToolchain)
383381
} else {
384382
sourceSwiftToolchain = nil

0 commit comments

Comments
 (0)