Skip to content

Commit 633801d

Browse files
committed
Fix clangLibraryPath for Windows
1 parent 3c0feb3 commit 633801d

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

Sources/SwiftDriver/Jobs/Toolchain+LinkerSupport.swift

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,20 @@ extension Toolchain {
5454
for triple: Triple,
5555
parsedOptions: inout ParsedOptions
5656
) throws -> AbsolutePath {
57-
return try computeResourceDirPath(for: triple,
58-
parsedOptions: &parsedOptions,
59-
isShared: true)
60-
.parentDirectory // Remove platform name.
61-
.appending(components: "clang", "lib",
62-
triple.platformName(conflatingDarwin: true)!)
57+
#if os(Windows)
58+
return try getToolPath(.swiftCompiler)
59+
.parentDirectory // remove /swift
60+
.parentDirectory // remove /bin
61+
.appending(components: "lib", "swift", "clang", "lib",
62+
triple.platformName(conflatingDarwin: true)!)
63+
#else
64+
return try computeResourceDirPath(for: triple,
65+
parsedOptions: &parsedOptions,
66+
isShared: true)
67+
.parentDirectory // Remove platform name.
68+
.appending(components: "clang", "lib",
69+
triple.platformName(conflatingDarwin: true)!)
70+
#endif
6371
}
6472

6573
func runtimeLibraryPaths(

0 commit comments

Comments
 (0)