# functions never throw a C++ exception.
target_add_compile_flags_if_supported(${target} PUBLIC -EHsc)
else()
- target_compile_definitions(${target} PUBLIC -D_LIBCPP_NO_EXCEPTIONS)
target_add_compile_flags_if_supported(${target} PUBLIC -EHs- -EHa-)
target_add_compile_flags_if_supported(${target} PUBLIC -fno-exceptions)
endif()
typedef __char32_t char32_t;
#endif
-#if !(__has_feature(cxx_exceptions)) && !defined(_LIBCPP_NO_EXCEPTIONS)
-#define _LIBCPP_NO_EXCEPTIONS
+#if !__has_feature(cxx_exceptions)
+# define _LIBCPP_NO_EXCEPTIONS
#endif
#if !(__has_feature(cxx_rtti)) && !defined(_LIBCPP_NO_RTTI)
#define _LIBCPP_NORETURN __attribute__((noreturn))
-#if !__EXCEPTIONS && !defined(_LIBCPP_NO_EXCEPTIONS)
-#define _LIBCPP_NO_EXCEPTIONS
+#if !__EXCEPTIONS
+# define _LIBCPP_NO_EXCEPTIONS
#endif
// Determine if GCC supports relaxed constexpr
// When exceptions are disabled, all iterators should get this "fast path"
//
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_NO_EXCEPTIONS
+// ADDITIONAL_COMPILE_FLAGS: -fno-exceptions
#include <iterator>
#include <cassert>
# Do we really need to be run through the C compiler ?
add_c_compile_flags_if_supported(-funwind-tables)
else()
- add_definitions(-D_LIBCXXABI_NO_EXCEPTIONS)
add_compile_flags_if_supported(-fno-exceptions)
add_compile_flags_if_supported(-EHs-)
add_compile_flags_if_supported(-EHa-)
# define _LIBCXXABI_GUARD_ABI_ARM
#endif
+#if defined(_LIBCXXABI_COMPILER_CLANG)
+# if !__has_feature(cxx_exceptions)
+# define _LIBCXXABI_NO_EXCEPTIONS
+# endif
+#elif defined(_LIBCXXABI_COMPILER_GCC) && !__EXCEPTIONS
+# define _LIBCXXABI_NO_EXCEPTIONS
+#endif
+
#endif // ____CXXABI_CONFIG_H
} else {
cflags_cc += [ "-fno-exceptions" ]
}
- defines += [ "_LIBCPP_NO_EXCEPTIONS" ]
}
if (!libcxx_enable_rtti) {
if (current_os == "win") {