File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Sources/SwiftDriver/ExplicitModuleBuilds Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -319,10 +319,20 @@ public extension Driver {
319
319
} else {
320
320
sharedLibExt = " .so "
321
321
}
322
- return try getRootPath ( of: toolchain, env: env) . appending ( component: " lib " )
322
+ let libScanner = " lib_InternalSwiftScan \( sharedLibExt) "
323
+ // We first look into position in toolchain
324
+ var libPath
325
+ = try getRootPath ( of: toolchain, env: env) . appending ( component: " lib " )
323
326
. appending ( component: " swift " )
324
327
. appending ( component: hostTriple. osNameUnversioned)
325
- . appending ( component: " lib_InternalSwiftScan " + sharedLibExt)
328
+ . appending ( component: libScanner)
329
+ if localFileSystem. exists ( libPath) {
330
+ return libPath
331
+ }
332
+ // In case we are using a compiler from the build dir, we should also try
333
+ // this path.
334
+ return try getRootPath ( of: toolchain, env: env) . appending ( component: " lib " )
335
+ . appending ( component: libScanner)
326
336
}
327
337
328
338
fileprivate static func getRootPath( of toolchain: Toolchain , env: [ String : String ] )
You can’t perform that action at this time.
0 commit comments