# RTTI flags ==================================================================
function(cxx_add_rtti_flags target)
if (NOT LIBCXX_ENABLE_RTTI)
- target_compile_definitions(${target} PUBLIC -D_LIBCPP_NO_RTTI)
target_add_compile_flags_if_supported(${target} PUBLIC -GR-)
target_add_compile_flags_if_supported(${target} PUBLIC -fno-rtti)
endif()
# define _LIBCPP_NO_EXCEPTIONS
#endif
-#if !(__has_feature(cxx_rtti)) && !defined(_LIBCPP_NO_RTTI)
-#define _LIBCPP_NO_RTTI
-#endif
-
#if !(__has_feature(cxx_strong_enums))
#define _LIBCPP_HAS_NO_STRONG_ENUMS
#endif
#endif
// Try to find out if RTTI is disabled.
-// g++ and cl.exe have RTTI on by default and define a macro when it is.
-#if !defined(_LIBCPP_NO_RTTI)
-# if defined(__GNUC__) && !defined(__GXX_RTTI)
-# define _LIBCPP_NO_RTTI
-# elif defined(_LIBCPP_COMPILER_MSVC) && !defined(_CPPRTTI)
-# define _LIBCPP_NO_RTTI
-# endif
+#if defined(_LIBCPP_COMPILER_CLANG) && !__has_feature(cxx_rtti)
+# define _LIBCPP_NO_RTTI
+#elif defined(__GNUC__) && !defined(__GXX_RTTI)
+# define _LIBCPP_NO_RTTI
+#elif defined(_LIBCPP_COMPILER_MSVC) && !defined(_CPPRTTI)
+# define _LIBCPP_NO_RTTI
#endif
#ifndef _LIBCPP_WEAK
enable_rtti = self.get_lit_bool('enable_rtti', True)
if not enable_rtti:
self.config.available_features.add('-fno-rtti')
- self.cxx.compile_flags += ['-fno-rtti', '-D_LIBCPP_NO_RTTI']
+ self.cxx.compile_flags += ['-fno-rtti']
def configure_link_flags(self):
# Configure library path