Skip to content

Commit ab48388

Browse files
committed
Jobs: support multiple lookup paths
Adjust the driver to include the additional library paths that the driver may want to use. We would previously only add a single path which worked due to internal ordering assumptions that held up. This makes the driver more resilient to changes to the target info.
1 parent 688a840 commit ab48388

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sources/SwiftDriver/Jobs/WindowsToolchain+LinkerSupport.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,10 @@ extension WindowsToolchain {
128128

129129
// Since Windows has separate libraries per architecture, link against the
130130
// architecture specific version of the static library.
131-
commandLine.appendFlag(.L)
132-
commandLine.appendPath(VirtualPath.lookup(targetInfo.runtimeLibraryImportPaths.last!.path))
131+
for libpath in targetInfo.runtimeLibraryImportPaths {
132+
commandLine.appendFlag(.L)
133+
commandLine.appendPath(VirtualPath.lookup(libpath.path))
134+
}
133135

134136
if !parsedOptions.hasArgument(.nostartfiles) {
135137
// Locate the Swift registration helper by honouring any explicit

0 commit comments

Comments
 (0)