Skip to content

Commit ebc0a37

Browse files
committed
Set Swift language version to 5
The stdlib needs to build in Swift-5 mode, and ensure that `-swift-verion 5` be included in the commandline explicitly. While the compiler defaults to 5 mode, if it's not included explicitly, it won't be included in the swift interface, which then means that modules that import it will influence how the textual interface is processed. The interface for the stdlib must be processed in the Swift 5 language mode due to sendability. Set it explicitly to ensure that importing modules do not change the Swift language mode. Fixes: rdar://145118843
1 parent 4dae976 commit ebc0a37

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Runtimes/Core/cmake/modules/CompilerSettings.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
include(CheckSourceCompiles)
22
include(CheckCompilerFlag)
33

4-
# Use C+17
4+
# Use Swift 5 mode
5+
set(CMAKE_Swift_LANGUAGE_VERSION 5)
6+
7+
# Use C++17
58
set(SwiftCore_MIN_CXX_STANDARD 17)
69
# Unset CMAKE_CXX_STANDARD if it's too low and in the CMakeCache.txt
710
if($CACHE{CMAKE_CXX_STANDARD} AND $CACHE{CMAKE_CXX_STANDARD} LESS ${SwiftCore_MIN_CXX_STANDARD})

0 commit comments

Comments
 (0)