Skip to content

[SwiftCompilerSources][build] Bump the minimum supported compiler version to 5.9 #76575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions SwiftCompilerSources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,12 @@ function(add_swift_compiler_modules_library name)
set(swift_compile_options
"-color-diagnostics"
"-Xfrontend" "-validate-tbd-against-ir=none"
"${cxx_interop_flag}"
"-cxx-interoperability-mode=default"
"-Xfrontend" "-disable-target-os-checking"
"-Xcc" "-std=c++17"
"-Xcc" "-DCOMPILED_WITH_SWIFT" "-Xcc" "-DSWIFT_TARGET"
"-Xcc" "-UIBOutlet" "-Xcc" "-UIBAction" "-Xcc" "-UIBInspectable")

# Prior to 5.9, we have to use the experimental flag for C++ interop.
if (CMAKE_Swift_COMPILER_VERSION VERSION_LESS 5.9)
list(APPEND swift_compile_options "-Xfrontend" "-enable-experimental-cxx-interop")
else()
list(APPEND swift_compile_options "-cxx-interoperability-mode=default")
endif()

if (NOT BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS")
if(SWIFT_MIN_RUNTIME_VERSION)
list(APPEND swift_compile_options
Expand Down Expand Up @@ -327,7 +320,7 @@ else()
message(FATAL_ERROR "The Swift compiler (${CMAKE_Swift_COMPILER}) differs from the Swift compiler in SWIFT_NATIVE_SWIFT_TOOLS_PATH (${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/swiftc).")
endif()

set(min_supported_swift_version 5.8)
set(min_supported_swift_version 5.9)
if(CMAKE_Swift_COMPILER_VERSION VERSION_LESS "${min_supported_swift_version}")
message(FATAL_ERROR
"Outdated Swift compiler: building with host tools requires Swift ${min_supported_swift_version} or newer. "
Expand Down