Skip to content

Commit e48171a

Browse files
authored
Make --ld-path option consistently use single dash (#1441)
The vast majority of other options on Swift Driver already use a single dash.
1 parent a213096 commit e48171a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Sources/SwiftOptions/Options.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ extension Option {
531531
public static let json_: Option = Option("--json", .flag, alias: Option.json, attributes: [.noDriver], helpText: "Print output in JSON format.")
532532
public static let j: Option = Option("-j", .joinedOrSeparate, attributes: [.doesNotAffectIncrementalBuild], metaVar: "<n>", helpText: "Number of commands to execute in parallel")
533533
public static let LEQ: Option = Option("-L=", .joined, alias: Option.L, attributes: [.frontend, .doesNotAffectIncrementalBuild, .argumentIsPath], group: .linkerOption)
534-
public static let ldPath: Option = Option("--ld-path=", .joined, attributes: [.helpHidden, .doesNotAffectIncrementalBuild, .argumentIsPath], helpText: "Specifies the path to the linker to be used")
534+
public static let ldPath: Option = Option("-ld-path=", .joined, attributes: [.helpHidden, .doesNotAffectIncrementalBuild, .argumentIsPath], helpText: "Specifies the path to the linker to be used")
535535
public static let libc: Option = Option("-libc", .separate, attributes: [], helpText: "libc runtime library to use")
536536
public static let libraryLevelEQ: Option = Option("-library-level=", .joined, alias: Option.libraryLevel, attributes: [.helpHidden, .frontend, .moduleInterface], metaVar: "<level>")
537537
public static let libraryLevel: Option = Option("-library-level", .separate, attributes: [.helpHidden, .frontend, .moduleInterface], metaVar: "<level>", helpText: "Library distribution level 'api', 'spi' or 'other' (the default)")

Tests/SwiftDriverTests/SwiftDriverTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1679,7 +1679,7 @@ final class SwiftDriverTests: XCTestCase {
16791679

16801680
do {
16811681
// macOS target
1682-
var driver = try Driver(args: commonArgs + ["-emit-library", "-target", "x86_64-apple-macosx10.15", "-Onone", "-use-ld=foo", "--ld-path=/bar/baz"], env: env)
1682+
var driver = try Driver(args: commonArgs + ["-emit-library", "-target", "x86_64-apple-macosx10.15", "-Onone", "-use-ld=foo", "-ld-path=/bar/baz"], env: env)
16831683
let plannedJobs = try driver.planBuild()
16841684

16851685
XCTAssertEqual(3, plannedJobs.count)
@@ -1691,7 +1691,7 @@ final class SwiftDriverTests: XCTestCase {
16911691
let cmd = linkJob.commandLine
16921692
XCTAssertTrue(cmd.contains(.flag("-dynamiclib")))
16931693
XCTAssertTrue(cmd.contains(.flag("-fuse-ld=foo")))
1694-
XCTAssertTrue(cmd.contains(.joinedOptionAndPath("--ld-path=", try VirtualPath(path: "/bar/baz"))))
1694+
XCTAssertTrue(cmd.contains(.joinedOptionAndPath("-ld-path=", try VirtualPath(path: "/bar/baz"))))
16951695
XCTAssertTrue(cmd.contains(.flag("--target=x86_64-apple-macosx10.15")))
16961696
XCTAssertEqual(linkJob.outputs[0].file, try VirtualPath(path: "libTest.dylib"))
16971697

0 commit comments

Comments
 (0)