File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -101,12 +101,19 @@ function(add_swift_compiler_modules_library name)
101
101
set (swift_compile_options
102
102
"-color-diagnostics"
103
103
"-Xfrontend" "-validate-tbd-against-ir=none"
104
- "-cxx-interoperability-mode=default "
104
+ "${cxx_interop_flag} "
105
105
"-Xfrontend" "-disable-target-os-checking"
106
106
"-Xcc" "-std=c++17"
107
107
"-Xcc" "-DCOMPILED_WITH_SWIFT" "-Xcc" "-DSWIFT_TARGET"
108
108
"-Xcc" "-UIBOutlet" "-Xcc" "-UIBAction" "-Xcc" "-UIBInspectable" )
109
109
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
+
110
117
if (NOT BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS" )
111
118
if (SWIFT_MIN_RUNTIME_VERSION )
112
119
list (APPEND swift_compile_options
@@ -334,7 +341,7 @@ else()
334
341
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)." )
335
342
endif ()
336
343
337
- set (min_supported_swift_version 5.9 )
344
+ set (min_supported_swift_version 5.8 )
338
345
if (CMAKE_Swift_COMPILER_VERSION VERSION_LESS "${min_supported_swift_version} " )
339
346
message (FATAL_ERROR
340
347
"Outdated Swift compiler: building with host tools requires Swift ${min_supported_swift_version} or newer. "
You can’t perform that action at this time.
0 commit comments