Skip to content

Commit cd1ac40

Browse files
committed
Build in Swift 6 mode using CMake
The CMake build should only be run when building an entire toolchain, which means that we are guaranteed to have a Swift 6 compiler at hand and can unconditionally enable Swift 6 mode.
1 parent cc8ce97 commit cd1ac40

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

Sources/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:-package-name SourceKitLSP>")
2+
add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:-DRESILIENT_LIBRARIES>")
3+
add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:-swift-version 6>")
24
add_subdirectory(BuildServerProtocol)
35
add_subdirectory(BuildSystemIntegration)
46
add_subdirectory(CAtomics)

Sources/SourceKitLSP/Swift/CodeActions/ConvertIntegerLiteral.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ struct ConvertIntegerLiteral: SyntaxCodeActionProvider {
5151
prefix = "0x"
5252
case .decimal:
5353
prefix = ""
54+
#if RESILIENT_LIBRARIES
55+
@unknown default:
56+
fatalError("Unknown case")
57+
#endif
5458
}
5559

5660
let convertedValue: ExprSyntax =

Sources/SourceKitLSP/Swift/Diagnostic.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,10 @@ fileprivate extension SwiftDiagnostics.DiagnosticSeverity {
423423
case .warning: return .warning
424424
case .note: return .information
425425
case .remark: return .hint
426+
#if RESILIENT_LIBRARIES
427+
@unknown default:
428+
fatalError("Unknown case")
429+
#endif
426430
}
427431
}
428432
}

0 commit comments

Comments
 (0)