File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -30,14 +30,17 @@ private struct UserManifestResources: ManifestResourceProvider {
30
30
}
31
31
32
32
// FIXME: This is messy and needs a redesign.
33
- public struct UserToolchain : Toolchain {
33
+ public final class UserToolchain : Toolchain {
34
34
35
35
/// The manifest resource provider.
36
36
public let manifestResources : ManifestResourceProvider
37
37
38
38
/// Path of the `swiftc` compiler.
39
39
public let swiftCompiler : AbsolutePath
40
40
41
+ /// Storage for clang compiler path.
42
+ private var _clangCompiler : AbsolutePath ?
43
+
41
44
public let extraCCFlags : [ String ]
42
45
43
46
public let extraSwiftCFlags : [ String ]
@@ -128,6 +131,10 @@ public struct UserToolchain: Toolchain {
128
131
129
132
public func getClangCompiler( ) throws -> AbsolutePath {
130
133
134
+ if let clangCompiler = _clangCompiler {
135
+ return clangCompiler
136
+ }
137
+
131
138
let clangCompiler : AbsolutePath
132
139
133
140
// Find the Clang compiler, looking first in the environment.
@@ -146,6 +153,7 @@ public struct UserToolchain: Toolchain {
146
153
guard localFileSystem. isExecutableFile ( clangCompiler) else {
147
154
throw Error . invalidToolchain ( problem: " could not find `clang` at expected path \( clangCompiler. asString) " )
148
155
}
156
+ _clangCompiler = clangCompiler
149
157
return clangCompiler
150
158
}
151
159
You can’t perform that action at this time.
0 commit comments