Skip to content

Commit 512baf9

Browse files
committed
Fix build on Windows: put ExitStatus.signalled under os check
1 parent dd33c84 commit 512baf9

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

Sources/SwiftDriver/Driver/ToolExecutionDelegate.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,12 @@ public struct ToolExecutionDelegate: JobExecutionDelegate {
7777
let finishedMessage = FinishedMessage(exitStatus: Int(code), pid: pid, output: output)
7878
message = ParsableMessage(name: job.kind.rawValue, kind: .finished(finishedMessage))
7979

80+
#if !os(Windows)
8081
case .signalled(let signal):
8182
let errorMessage = strsignal(signal).map { String(cString: $0) } ?? ""
8283
let signalledMessage = SignalledMessage(pid: pid, output: output, errorMessage: errorMessage, signal: Int(signal))
8384
message = ParsableMessage(name: job.kind.rawValue, kind: .signalled(signalledMessage))
85+
#endif
8486
}
8587
emit(message)
8688
}

Sources/SwiftDriver/Execution/DriverExecutor.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ extension DriverExecutor {
5555
switch result.exitStatus {
5656
case .terminated(let code):
5757
returnCode = Int(code)
58+
#if !os(Windows)
5859
case .signalled(let signal):
5960
returnCode = Int(signal)
61+
#endif
6062
}
6163
throw JobExecutionError.jobFailedWithNonzeroExitCode(returnCode, try result.utf8stderrOutput())
6264
}

Sources/SwiftDriver/Execution/MultiJobExecutor.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,10 @@ class ExecuteJobRule: LLBuildRule {
358358
if !job.kind.isCompile || code != EXIT_FAILURE {
359359
context.diagnosticsEngine.emit(.error_command_failed(kind: job.kind, code: code))
360360
}
361+
#if !os(Windows)
361362
case let .signalled(signal):
362363
context.diagnosticsEngine.emit(.error_command_signalled(kind: job.kind, signal: signal))
364+
#endif
363365
}
364366
}
365367

0 commit comments

Comments
 (0)