Browse Source

Disable RTTI on x-plat

Jack Horton 8 years ago
parent
commit
badcf47b0a
2 changed files with 9 additions and 1 deletions
  1. 6 1
      CMakeLists.txt
  2. 3 0
      lib/Runtime/PlatformAgnostic/Platform/CMakeLists.txt

+ 6 - 1
CMakeLists.txt

@@ -346,9 +346,14 @@ if(CLR_CMAKE_PLATFORM_XPLAT)
     add_compile_options(
         -fasm-blocks
         -fms-extensions
-        -fwrapv                 # Treat signed integer overflow as two's complement
+        -fwrapv # Treat signed integer overflow as two's complement
     )
 
+    # Only disable RTTI in release builds so that TrackAlloc works for debug and test builds
+    if(CMAKE_BUILD_TYPE STREQUAL Release)
+        add_compile_options(-fno-rtti)
+    endif()
+
     # Clang -fsanitize.
     if (CLANG_SANITIZE_SH)
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=${CLANG_SANITIZE_SH}")

+ 3 - 0
lib/Runtime/PlatformAgnostic/Platform/CMakeLists.txt

@@ -28,6 +28,9 @@ if(ICU_INTL_ENABLED)
 set(PL_SOURCE_FILES ${PL_SOURCE_FILES}
   Common/Intl.cpp
   )
+add_compile_options(
+  -frtti
+)
 endif()
 
 if(NOT STATIC_LIBRARY)