Skip to content

Commit 5010c03

Browse files
committed
[SwiftCompilerSources][build] Require recent Swift compiler in HOSTTOOLS mode
Some code in SwiftCompilerSources, especially the parts that use C++ interop, triggers bugs in older versions of the Swift compiler. To make sure that `HOSTTOOLS` builds don't produce obscure compiler errors or crashes, let's require a relatively new Swift compiler for `HOSTTOOLS` build.
1 parent 72b3e6b commit 5010c03

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

SwiftCompilerSources/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,12 @@ else()
203203
if (NOT CMAKE_Swift_COMPILER)
204204
message(FATAL_ERROR "Need a swift toolchain building swift compiler sources")
205205
endif()
206+
set(min_supported_swift_version 5.5)
207+
if(CMAKE_Swift_COMPILER_VERSION VERSION_LESS "${min_supported_swift_version}")
208+
message(FATAL_ERROR
209+
"Outdated Swift compiler: building with host tools requires Swift ${min_supported_swift_version} or newer. "
210+
"Please update your Swift toolchain or switch BOOTSTRAPPING_MODE to BOOTSTRAPPING(-WITH-HOSTLIBS)? or OFF.")
211+
endif()
206212

207213
add_swift_compiler_modules_library(swiftCompilerModules
208214
SWIFT_EXEC "${CMAKE_Swift_COMPILER}")

0 commit comments

Comments
 (0)