Skip to content

Commit 1444a8b

Browse files
authored
Merge pull request #1433 from compnerd/virtual-paths
SwiftDriver: speculative changes to support Windows macros
2 parents 4d7f6a0 + e58fa62 commit 1444a8b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Sources/SwiftDriver/Toolchains/DarwinToolchain.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,13 +482,21 @@ extension VirtualPath {
482482
// Given a virtual path pointing into a toolchain/SDK/platform, produce the
483483
// path to `swift-plugin-server`.
484484
fileprivate var pluginServerPath: VirtualPath {
485+
#if os(Windows)
486+
self.appending(components: "bin", "swift-plugin-server.exe")
487+
#else
485488
self.appending(components: "bin", "swift-plugin-server")
489+
#endif
486490
}
487491

488492
// Given a virtual path pointing into a toolchain/SDK/platform, produce the
489493
// path to the plugins.
490494
var pluginPath: VirtualPath {
495+
#if os(Windows)
496+
self.appending(components: "bin")
497+
#else
491498
self.appending(components: "lib", "swift", "host", "plugins")
499+
#endif
492500
}
493501

494502
// Given a virtual path pointing into a toolchain/SDK/platform, produce the

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6939,8 +6939,12 @@ final class SwiftDriverTests: XCTestCase {
69396939
#endif
69406940

69416941
XCTAssertTrue(job.commandLine.contains(.flag("-plugin-path")))
6942+
#if os(Windows)
6943+
XCTAssertTrue(job.commandLine.contains(.path(.absolute(try driver.toolchain.executableDir.parentDirectory.appending(components: "bin")))))
6944+
#else
69426945
XCTAssertTrue(job.commandLine.contains(.path(.absolute(try driver.toolchain.executableDir.parentDirectory.appending(components: "lib", "swift", "host", "plugins")))))
69436946
XCTAssertTrue(job.commandLine.contains(.path(.absolute(try driver.toolchain.executableDir.parentDirectory.appending(components: "local", "lib", "swift", "host", "plugins")))))
6947+
#endif
69446948
}
69456949

69466950
func testClangModuleValidateOnce() throws {

0 commit comments

Comments
 (0)