File tree Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -434,9 +434,8 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" AND BOOTSTRAPPING_MODE STREQUAL "HO
434
434
endif ()
435
435
436
436
if (BRIDGING_MODE STREQUAL "DEFAULT" OR NOT BRIDGING_MODE )
437
- if (CMAKE_BUILD_TYPE STREQUAL "Debug" OR " ${SWIFT_HOST_VARIANT_SDK} " STREQUAL "WINDOWS" OR (CMAKE_Swift_COMPILER AND CMAKE_Swift_COMPILER_VERSION VERSION_LESS 5.8 ))
437
+ if (CMAKE_BUILD_TYPE STREQUAL "Debug" OR (CMAKE_Swift_COMPILER AND CMAKE_Swift_COMPILER_VERSION VERSION_LESS 5.8 ))
438
438
# In debug builds, to workaround a problem with LLDB's `po` command (rdar://115770255).
439
- # On Windows, to workaround a build problem.
440
439
# If the host Swift version is less than 5.8, use pure mode to workaround a C++ interop compiler crash.
441
440
set (BRIDGING_MODE "PURE" )
442
441
else ()
Original file line number Diff line number Diff line change @@ -177,6 +177,8 @@ function(add_swift_compiler_modules_library name)
177
177
if (CMAKE_SYSTEM_NAME STREQUAL "Windows" )
178
178
list (APPEND swift_compile_options "-static" )
179
179
list (APPEND sdk_option "-sdk" "${SWIFT_PATH_TO_SWIFT_SDK} " )
180
+ # For "swift/shims/*.h".
181
+ list (APPEND sdk_option "-I" "${SWIFT_PATH_TO_SWIFT_SDK} /usr/lib" )
180
182
181
183
# Workaround a crash in the LoadableByAddress pass
182
184
# https://github.com/apple/swift/issues/73254
@@ -188,6 +190,12 @@ function(add_swift_compiler_modules_library name)
188
190
if (CMAKE_Swift_COMPILER_VERSION VERSION_LESS 6.0 )
189
191
list (APPEND swift_compile_options "-Xcc" "-D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH" )
190
192
endif ()
193
+
194
+ # Make 'offsetof()' a const value.
195
+ list (APPEND swift_compile_options "-Xcc" "-D_CRT_USE_BUILTIN_OFFSETOF" )
196
+
197
+ # Workaround for https://github.com/swiftlang/llvm-project/issues/7172
198
+ list (APPEND swift_compile_options "-Xcc" "-Xclang" "-Xcc" "-fmodule-format=raw" )
191
199
else ()
192
200
list (APPEND sdk_option "-I" "${swift_exec_bin_dir} /../lib" "-I" "${sdk_path} /usr/lib" )
193
201
endif ()
Original file line number Diff line number Diff line change @@ -93,13 +93,19 @@ set(compile_options
93
93
94
94
# Necessary to avoid treating IBOutlet and IBAction as keywords
95
95
"SHELL:-Xcc -UIBOutlet -Xcc -UIBAction -Xcc -UIBInspectable"
96
-
97
- "SHELL:-Xcc -D_CRT_USE_BUILTIN_OFFSETOF"
98
96
)
99
97
98
+ if (CMAKE_SYSTEM_NAME STREQUAL "Windows" )
99
+ list (APPEND compile_options
100
+ # Make 'offsetof()' a const value.
101
+ "SHELL:-Xcc -D_CRT_USE_BUILTIN_OFFSETOF"
102
+ # Workaround for https://github.com/swiftlang/llvm-project/issues/7172
103
+ "SHELL:-Xcc -Xclang -Xcc -fmodule-format=raw" )
104
+ endif ()
105
+
100
106
# Prior to 5.9, we have to use the experimental flag for C++ interop.
101
107
if (CMAKE_Swift_COMPILER_VERSION VERSION_LESS 5.9 )
102
- list (APPEND compile_options "-Xfrontend" " -enable-experimental-cxx-interop" )
108
+ list (APPEND compile_options "SHELL: -Xfrontend -enable-experimental-cxx-interop" )
103
109
else ()
104
110
list (APPEND compile_options "-cxx-interoperability-mode=default" )
105
111
endif ()
You can’t perform that action at this time.
0 commit comments