Skip to content

Commit 204e517

Browse files
authored
Merge pull request #14917 from compnerd/fno-rtti-data
2 parents c3138e6 + 4585bc5 commit 204e517

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
@@ -248,6 +248,13 @@ function(_add_variant_c_compile_flags)
248248
list(APPEND result "-D_DLL")
249249
# NOTE: We assume that we are using VS 2015 U2+
250250
list(APPEND result "-D_ENABLE_ATOMIC_ALIGNMENT_FIX")
251+
252+
# msvcprt's std::function requires RTTI, but we do not want RTTI data.
253+
# Emulate /GR-
254+
if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)
255+
list(APPEND result -frtti)
256+
list(APPEND result -Xclang;-fno-rtti-data)
257+
endif()
251258
endif()
252259

253260
if(CFLAGS_ENABLE_ASSERTIONS)

0 commit comments

Comments
 (0)