Skip to content

Commit e062c54

Browse files
authored
Add bazel feature for wasm-exceptions (#1575)
This PR add bazel feature for `-fwasm-exceptions` Part of #1400
1 parent d49219d commit e062c54

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

bazel/emscripten_toolchain/toolchain.bzl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,9 @@ def _impl(ctx):
363363
# Set if enabling exceptions.
364364
feature(name = "exceptions"),
365365

366+
# Set if enabling wasm_exceptions.
367+
feature(name = "wasm_exceptions"),
368+
366369
# This feature overrides the default optimization to prefer execution speed
367370
# over binary size (like clang -O3).
368371
feature(
@@ -515,7 +518,7 @@ def _impl(ctx):
515518
flags = [
516519
"-fno-exceptions",
517520
],
518-
not_features = ["exceptions"],
521+
not_features = ["exceptions", "wasm_exceptions"],
519522
),
520523
flag_set(
521524
actions = all_cpp_compile_actions,
@@ -524,6 +527,14 @@ def _impl(ctx):
524527
],
525528
features = ["exceptions"],
526529
),
530+
flag_set(
531+
actions = all_cpp_compile_actions +
532+
all_link_actions,
533+
flags = [
534+
"-fwasm-exceptions",
535+
],
536+
features = ["wasm_exceptions"],
537+
),
527538
# All compiles (and implicitly link)
528539
flag_set(
529540
actions = all_compile_actions +

0 commit comments

Comments
 (0)