File tree Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -127,18 +127,20 @@ extension Toolchain {
127
127
128
128
var foundAny = false
129
129
130
- let clangPath = binPath. appending ( component: " clang " )
130
+ let execExt = Platform . currentPlatform? . executableExtension ?? " "
131
+
132
+ let clangPath = binPath. appending ( component: " clang \( execExt) " )
131
133
if fs. isExecutableFile ( clangPath) {
132
134
self . clang = clangPath
133
135
foundAny = true
134
136
}
135
- let clangdPath = binPath. appending ( component: " clangd " )
137
+ let clangdPath = binPath. appending ( component: " clangd \( execExt ) " )
136
138
if fs. isExecutableFile ( clangdPath) {
137
139
self . clangd = clangdPath
138
140
foundAny = true
139
141
}
140
142
141
- let swiftcPath = binPath. appending ( component: " swiftc " )
143
+ let swiftcPath = binPath. appending ( component: " swiftc \( execExt ) " )
142
144
if fs. isExecutableFile ( swiftcPath) {
143
145
self . swiftc = swiftcPath
144
146
foundAny = true
Original file line number Diff line number Diff line change @@ -19,6 +19,14 @@ extension Platform {
19
19
switch self {
20
20
case . darwin: return " .dylib "
21
21
case . linux, . android: return " .so "
22
+ case . windows: return " .dll "
23
+ }
24
+ }
25
+
26
+ public var executableExtension : String {
27
+ switch self {
28
+ case . windows: return " .exe "
29
+ case . linux, . android, . darwin: return " "
22
30
}
23
31
}
24
32
}
Original file line number Diff line number Diff line change @@ -516,14 +516,16 @@ private func makeToolchain(
516
516
}
517
517
}
518
518
519
+ let execExt = Platform . currentPlatform? . executableExtension ?? " "
520
+
519
521
if clang {
520
- makeExec ( binPath. appending ( component: " clang " ) )
522
+ makeExec ( binPath. appending ( component: " clang \( execExt ) " ) )
521
523
}
522
524
if clangd {
523
- makeExec ( binPath. appending ( component: " clangd " ) )
525
+ makeExec ( binPath. appending ( component: " clangd \( execExt ) " ) )
524
526
}
525
527
if swiftc {
526
- makeExec ( binPath. appending ( component: " swiftc " ) )
528
+ makeExec ( binPath. appending ( component: " swiftc \( execExt ) " ) )
527
529
}
528
530
529
531
let dylibExt = Platform . currentPlatform? . dynamicLibraryExtension ?? " .so "
You can’t perform that action at this time.
0 commit comments