Skip to content

Commit 43b28bf

Browse files
committed
Revert "[SwiftCompilerSources][build] Bump the minimum supported compiler version to 5.9"
This reverts commit c6ce6ee.
1 parent 568b2f7 commit 43b28bf

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

SwiftCompilerSources/CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,19 @@ function(add_swift_compiler_modules_library name)
101101
set(swift_compile_options
102102
"-color-diagnostics"
103103
"-Xfrontend" "-validate-tbd-against-ir=none"
104-
"-cxx-interoperability-mode=default"
104+
"${cxx_interop_flag}"
105105
"-Xfrontend" "-disable-target-os-checking"
106106
"-Xcc" "-std=c++17"
107107
"-Xcc" "-DCOMPILED_WITH_SWIFT" "-Xcc" "-DSWIFT_TARGET"
108108
"-Xcc" "-UIBOutlet" "-Xcc" "-UIBAction" "-Xcc" "-UIBInspectable")
109109

110+
# Prior to 5.9, we have to use the experimental flag for C++ interop.
111+
if (CMAKE_Swift_COMPILER_VERSION VERSION_LESS 5.9)
112+
list(APPEND swift_compile_options "-Xfrontend" "-enable-experimental-cxx-interop")
113+
else()
114+
list(APPEND swift_compile_options "-cxx-interoperability-mode=default")
115+
endif()
116+
110117
if (NOT BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS")
111118
if(SWIFT_MIN_RUNTIME_VERSION)
112119
list(APPEND swift_compile_options
@@ -334,7 +341,7 @@ else()
334341
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).")
335342
endif()
336343

337-
set(min_supported_swift_version 5.9)
344+
set(min_supported_swift_version 5.8)
338345
if(CMAKE_Swift_COMPILER_VERSION VERSION_LESS "${min_supported_swift_version}")
339346
message(FATAL_ERROR
340347
"Outdated Swift compiler: building with host tools requires Swift ${min_supported_swift_version} or newer. "

0 commit comments

Comments
 (0)