Skip to content

Commit 94676c0

Browse files
committed
Fix for linking tests with swiftbuild on windows
- need library search path to ExecutableModules for windows
1 parent 84b3e6e commit 94676c0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/SwiftBuildSupport/PackagePIFProjectBuilder+Modules.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,9 @@ extension PackagePIFProjectBuilder {
440440
// Redirect the built executable into a separate directory so it won't conflict with the real one.
441441
settings[.TARGET_BUILD_DIR] = "$(TARGET_BUILD_DIR)/ExecutableModules"
442442

443+
// on windows modules are libraries, so we need to add a search path so the linker finds them
444+
impartedSettings[.LIBRARY_SEARCH_PATHS, .windows] = ["$(inherited)", "$(TARGET_BUILD_DIR)/ExecutableModules"]
445+
443446
// Don't install the Swift module of the testable side-built artifact, lest it conflict with the regular
444447
// one.
445448
// The modules should have compatible contents in any case — only the entry point function name is

0 commit comments

Comments
 (0)