Skip to content

Commit 95518ae

Browse files
authored
Simplify WASM2JS setup code. NFC (emscripten-core#23968)
1 parent a741f7a commit 95518ae

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

tools/link.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -799,17 +799,17 @@ def phase_linker_setup(options, linker_args): # noqa: C901, PLR0912, PLR0915
799799
# to js.
800800
settings.WASM = 1
801801
settings.WASM2JS = 1
802-
# Wasm bigint doesn't make sense with wasm2js, since it controls how the
803-
# wasm and JS interact.
804-
if user_settings.get('WASM_BIGINT') and settings.WASM_BIGINT:
805-
exit_with_error('WASM_BIGINT=1 is not compatible with WASM=0 (wasm2js)')
806-
settings.WASM_BIGINT = 0
807-
feature_matrix.disable_feature(feature_matrix.Feature.JS_BIGINT_INTEGRATION)
802+
808803
if settings.WASM == 2:
809804
# Requesting both Wasm and Wasm2JS support
810805
settings.WASM2JS = 1
806+
807+
if settings.WASM2JS:
808+
settings.MAYBE_WASM2JS = 1
809+
# Wasm bigint doesn't make sense with wasm2js, since it controls how the
810+
# wasm and JS interact.
811811
if user_settings.get('WASM_BIGINT') and settings.WASM_BIGINT:
812-
exit_with_error('WASM_BIGINT=1 is not compatible with WASM=2 (wasm2js)')
812+
exit_with_error('WASM_BIGINT=1 is not compatible with wasm2js')
813813
settings.WASM_BIGINT = 0
814814
feature_matrix.disable_feature(feature_matrix.Feature.JS_BIGINT_INTEGRATION)
815815

@@ -1524,9 +1524,6 @@ def phase_linker_setup(options, linker_args): # noqa: C901, PLR0912, PLR0915
15241524
if options.use_closure_compiler == 2 and not settings.WASM2JS:
15251525
exit_with_error('closure compiler mode 2 assumes the code is asm.js, so not meaningful for wasm')
15261526

1527-
if settings.WASM2JS:
1528-
settings.MAYBE_WASM2JS = 1
1529-
15301527
if settings.AUTODEBUG:
15311528
settings.REQUIRED_EXPORTS += ['_emscripten_tempret_set']
15321529

0 commit comments

Comments
 (0)