Skip to content

Commit 1a480b4

Browse files
committed
Allow setting the clang++ environment variable
'+' isn't allowed in environment variable names so it's impossible to set the Clang++ executable at the moment. Replace `+` with `X` so that we can set `SWIFT_DRIVER_CLANGXX_EXEC` to set the clang++ executable.
1 parent 5833856 commit 1a480b4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/SwiftDriver/Toolchains/Toolchain.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,10 @@ extension Toolchain {
196196

197197
/// - Returns: String in the form of: `SWIFT_DRIVER_TOOLNAME_EXEC`
198198
private func envVarName(for toolName: String) -> String {
199-
let lookupName = toolName.replacingOccurrences(of: "-", with: "_").uppercased()
199+
let lookupName = toolName
200+
.replacingOccurrences(of: "-", with: "_")
201+
.replacingOccurrences(of: "+", with: "X")
202+
.uppercased()
200203
return "SWIFT_DRIVER_\(lookupName)_EXEC"
201204
}
202205

0 commit comments

Comments
 (0)