Skip to content

Commit da8eb3c

Browse files
authored
Merge pull request #19747 from compnerd/defaway
2 parents 2c86e32 + 6d2ea53 commit da8eb3c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,13 @@ function(_add_variant_c_compile_flags)
273273
# RTTI as well. This requires a newer SDK though and we do not have
274274
# guarantees on the SDK version currently.
275275
list(APPEND result "-D_HAS_STATIC_RTTI=0")
276+
277+
# NOTE(compnerd) workaround LLVM invoking `add_definitions(-D_DEBUG)` which
278+
# causes failures for the runtime library when cross-compiling due to
279+
# undefined symbols from the standard library.
280+
if(NOT CMAKE_BUILD_TYPE STREQUAL Debug)
281+
list(APPEND result "-U_DEBUG")
282+
endif()
276283
endif()
277284

278285
if(CFLAGS_ENABLE_ASSERTIONS)

0 commit comments

Comments
 (0)