Skip to content

Commit

Permalink
Add a compile flag to allow setting -fexceptions.
Browse files Browse the repository at this point in the history
Fixes #29368
  • Loading branch information
bzbarsky-apple committed Sep 21, 2023
1 parent 94853cf commit 1feb1c2
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 1feb1c2

Please sign in to comment.