Skip to content

Commit

Permalink
Make --ld-path option consistently use single dash (#1442)
Browse files Browse the repository at this point in the history
The vast majority of other options on Swift Driver already use a single dash.
  • Loading branch information
MaxDesiatov committed Sep 19, 2023
1 parent 4cf208c commit c6e4043
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Sources/SwiftOptions/Options.swift
Expand Up @@ -531,7 +531,7 @@ extension Option {
public static let json_: Option = Option("--json", .flag, alias: Option.json, attributes: [.noDriver], helpText: "Print output in JSON format.")
public static let j: Option = Option("-j", .joinedOrSeparate, attributes: [.doesNotAffectIncrementalBuild], metaVar: "<n>", helpText: "Number of commands to execute in parallel")
public static let LEQ: Option = Option("-L=", .joined, alias: Option.L, attributes: [.frontend, .doesNotAffectIncrementalBuild, .argumentIsPath], group: .linkerOption)
public static let ldPath: Option = Option("--ld-path=", .joined, attributes: [.helpHidden, .doesNotAffectIncrementalBuild, .argumentIsPath], helpText: "Specifies the path to the linker to be used")
public static let ldPath: Option = Option("-ld-path=", .joined, attributes: [.helpHidden, .doesNotAffectIncrementalBuild, .argumentIsPath], helpText: "Specifies the path to the linker to be used")
public static let libc: Option = Option("-libc", .separate, attributes: [], helpText: "libc runtime library to use")
public static let libraryLevelEQ: Option = Option("-library-level=", .joined, alias: Option.libraryLevel, attributes: [.helpHidden, .frontend, .moduleInterface], metaVar: "<level>")
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)")
Expand Down
4 changes: 2 additions & 2 deletions Tests/SwiftDriverTests/SwiftDriverTests.swift
Expand Up @@ -1679,7 +1679,7 @@ final class SwiftDriverTests: XCTestCase {

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

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

Expand Down

0 comments on commit c6e4043

Please sign in to comment.