diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index 31f396a4574c3a..c508d657b17ab2 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -485,8 +485,12 @@ config("coverage_default") { } declare_args() { - # Enable Runtime Type Information (RTTI) + # Enable or disable Runtime Type Information (RTTI). + # Defaults true on darwin because Darwin.framework uses it. enable_rtti = current_os == "mac" || current_os == "ios" + + # Enable or disable support for C++ exceptions. + enable_exceptions = false } config("no_rtti") { @@ -514,7 +518,11 @@ config("exceptions") { } config("exceptions_default") { - configs = [ ":no_exceptions" ] + if (enable_exceptions) { + configs = [ ":exceptions" ] + } else { + configs = [ ":no_exceptions" ] + } } config("unwind_tables") {