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 committed Sep 21, 2023
1 parent 6948a80 commit 30f8eb5
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 30f8eb5

Please sign in to comment.