Skip to content

Commit 5ba0f73

Browse files
committed
Fix windows libclang lookup
1 parent d764431 commit 5ba0f73

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -967,10 +967,10 @@ public class ClangCompilerSpec : CompilerSpec, SpecIdentifierType, GCCCompatible
967967

968968
// If not defined, try to find one from the toolchain.
969969
var candidatesSkipped: [Path] = []
970-
for (toolchainPath, toolchainLibrarySearchPath) in cbc.producer.toolchains.map({ ($0.path, $0.librarySearchPaths) }) {
971-
if let path = toolchainLibrarySearchPath.findLibrary(operatingSystem: cbc.producer.hostOperatingSystem, basename: "clang") {
970+
for toolchain in cbc.producer.toolchains {
971+
if let path = try? toolchain.lookup(subject: .library(basename: "clang"), operatingSystem: cbc.producer.hostOperatingSystem) {
972972
// Check that this is the same toolchain and version as the compiler. Mismatched clang/libclang is not supported with explicit modules.
973-
let compilerAndLibraryAreInSameToolchain = toolchainPath.isAncestor(of: compiler)
973+
let compilerAndLibraryAreInSameToolchain = toolchain.path.isAncestor(of: compiler)
974974
let libclangVersion = cbc.producer.lookupLibclang(path: path).version
975975
// On macOS we enforce a matching clang and libclang version, the versioning schemes on other host platforms currently make this difficult.
976976
let compilerAndLibraryVersionsMatch = libclangVersion != nil && libclangVersion == clangInfo?.clangVersion || cbc.producer.hostOperatingSystem != .macOS

0 commit comments

Comments
 (0)