Skip to content

Commit fe61238

Browse files
committed
SKCore: adjust library loading for Windows
The libIndexStore and sourcekitdInProc DLLs actually reside in the binaries directory on Windows. Adjust the paths appropriately for Windows. This is required to get the libraries to load correctly.
1 parent 2c4da0a commit fe61238

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Sources/SKCore/Toolchain.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,22 @@ extension Toolchain {
152152
self.sourcekitd = sourcekitdPath
153153
foundAny = true
154154
} else {
155+
#if os(Windows)
156+
let sourcekitdPath = binPath.appending(component: "sourcekitdInProc\(dylibExt)")
157+
#else
155158
let sourcekitdPath = libPath.appending(component: "libsourcekitdInProc\(dylibExt)")
159+
#endif
156160
if fs.isFile(sourcekitdPath) {
157161
self.sourcekitd = sourcekitdPath
158162
foundAny = true
159163
}
160164
}
161165

166+
#if os(Windows)
167+
let libIndexStore = binPath.appending(components: "libIndexStore\(dylibExt)")
168+
#else
162169
let libIndexStore = libPath.appending(components: "libIndexStore\(dylibExt)")
170+
#endif
163171
if fs.isFile(libIndexStore) {
164172
self.libIndexStore = libIndexStore
165173
foundAny = true

0 commit comments

Comments
 (0)