Skip to content

Commit 50fd6ea

Browse files
committed
[windows] Use unprefixed library name for immediate mode.
The library does not have the lib prefix in Windows, so the immediate mode was not finding the file. This was making the new tests in tests/Driver/options.swift fail on Windows. The tests pass after this change. Notice that it seems to load the host standard library, so restricting the change to Windows seems to be OK and should not affect cross-compilation. Windows was already hardcoding ".dll" as the library extension, disregarding the target, anyway.
1 parent 930699c commit 50fd6ea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/Immediate/Immediate.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ static void *loadRuntimeLib(StringRef sharedLibName,
7878

7979
void *swift::immediate::loadSwiftRuntime(ArrayRef<std::string>
8080
runtimeLibPaths) {
81+
#if defined(_WIN32)
82+
return loadRuntimeLib("swiftCore" LTDL_SHLIB_EXT, runtimeLibPaths);
83+
#else
8184
return loadRuntimeLib("libswiftCore" LTDL_SHLIB_EXT, runtimeLibPaths);
85+
#endif
8286
}
8387

8488
static bool tryLoadLibrary(LinkLibrary linkLib,

0 commit comments

Comments
 (0)