Skip to content

Commit

Permalink
Add a compile flag to allow setting -fexceptions. (#29376)
Browse files Browse the repository at this point in the history
Fixes #29368
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Jan 23, 2024
1 parent 9176978 commit 43a9ad7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down Expand Up @@ -514,7 +518,11 @@ config("exceptions") {
}

config("exceptions_default") {
configs = [ ":no_exceptions" ]
if (enable_exceptions) {
configs = [ ":exceptions" ]
} else {
configs = [ ":no_exceptions" ]
}
}

config("unwind_tables") {
Expand Down

0 comments on commit 43a9ad7

Please sign in to comment.