File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,8 @@ public final class UserToolchain: Toolchain {
129
129
return lookupExecutablePath ( filename: getenv ( variable) , searchPaths: searchPaths)
130
130
}
131
131
132
+ private let environment : [ String : String ]
133
+
132
134
public func getClangCompiler( ) throws -> AbsolutePath {
133
135
134
136
if let clangCompiler = _clangCompiler {
@@ -142,7 +144,7 @@ public final class UserToolchain: Toolchain {
142
144
clangCompiler = value
143
145
} else {
144
146
// No value in env, so search for `clang`.
145
- let foundPath = try Process . checkNonZeroExit ( arguments: whichClangArgs) . chomp ( )
147
+ let foundPath = try Process . checkNonZeroExit ( arguments: whichClangArgs, environment : environment ) . chomp ( )
146
148
guard !foundPath. isEmpty else {
147
149
throw InvalidToolchainDiagnostic ( " could not find `clang` " )
148
150
}
@@ -159,6 +161,7 @@ public final class UserToolchain: Toolchain {
159
161
160
162
public init ( destination: Destination , environment: [ String : String ] = Process . env) throws {
161
163
self . destination = destination
164
+ self . environment = environment
162
165
163
166
// Get the search paths from PATH.
164
167
let searchPaths = getEnvSearchPaths (
You can’t perform that action at this time.
0 commit comments