Skip to content

Commit f9ea3bd

Browse files
committed
[CMake] Disable RTTI and exceptions in stdlib
The C++ runtime bits should not have RTTI or exceptions enabled. Disabling those now, but keeping the unwind tables to match the old build.
1 parent 2ceb02c commit f9ea3bd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Runtimes/Core/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,11 @@ add_compile_definitions(
118118
$<$<COMPILE_LANGUAGE:C,CXX>:-DSWIFT_RUNTIME_ENABLE_LEAK_CHECKER=$<BOOL:${SwiftCore_ENABLE_RUNTIME_LEAK_CHECKER}>>
119119
$<$<COMPILE_LANGUAGE:C,CXX>:-DSWIFT_RUNTIME_CLOBBER_FREED_OBJECTS=$<BOOL:${SwiftCore_ENABLE_CLOBBER_FREED_OBJECTS}>>)
120120

121-
add_compile_options($<$<AND:$<COMPILE_LANGUAGE:Swift>,$<BOOL:${SwiftCore_ENABLE_LIBRARY_EVOLUTION}>>:-enable-library-evolution>)
121+
add_compile_options(
122+
$<$<COMPILE_LANGUAGE:CXX>:-fno-rtti>
123+
$<$<COMPILE_LANGUAGE:CXX>:-fno-exceptions>
124+
$<$<COMPILE_LANGUAGE:CXX>:-funwind-tables>
125+
$<$<AND:$<COMPILE_LANGUAGE:Swift>,$<BOOL:${SwiftCore_ENABLE_LIBRARY_EVOLUTION}>>:-enable-library-evolution>)
122126

123127
include_directories(include)
124128

0 commit comments

Comments
 (0)