Add bazel feature for wasm-exceptions (#1575)

This PR add bazel feature for `-fwasm-exceptions`

Part of #1400
This commit is contained in:
ZL
2025-07-22 14:06:54 +08:00
committed by GitHub
parent d49219d03a
commit e062c54f43

View File

@@ -363,6 +363,9 @@ def _impl(ctx):
# Set if enabling exceptions.
feature(name = "exceptions"),
# Set if enabling wasm_exceptions.
feature(name = "wasm_exceptions"),
# This feature overrides the default optimization to prefer execution speed
# over binary size (like clang -O3).
feature(
@@ -515,7 +518,7 @@ def _impl(ctx):
flags = [
"-fno-exceptions",
],
not_features = ["exceptions"],
not_features = ["exceptions", "wasm_exceptions"],
),
flag_set(
actions = all_cpp_compile_actions,
@@ -524,6 +527,14 @@ def _impl(ctx):
],
features = ["exceptions"],
),
flag_set(
actions = all_cpp_compile_actions +
all_link_actions,
flags = [
"-fwasm-exceptions",
],
features = ["wasm_exceptions"],
),
# All compiles (and implicitly link)
flag_set(
actions = all_compile_actions +