Skip to content

Commit d48ae60

Browse files
authored
Move WASMFS C++ link hack to emcc.py (#15179)
This way WasmFS can be used outside the test suite as well. Followup to #15147
1 parent f20313b commit d48ae60

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

emcc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2330,6 +2330,10 @@ def get_full_import_name(name):
23302330

23312331
settings.LINK_AS_CXX = (run_via_emxx or settings.DEFAULT_TO_CXX) and '-nostdlib++' not in newargs
23322332

2333+
# WASMFS itself is written in C++, and needs C++ standard libraries
2334+
if settings.WASMFS:
2335+
settings.LINK_AS_CXX = True
2336+
23332337
return target, wasm_target
23342338

23352339

tests/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ def verify_es5(self, filename):
551551
def build(self, filename, libraries=[], includes=[], force_c=False, js_outfile=True, emcc_args=[], output_basename=None):
552552
suffix = '.js' if js_outfile else '.wasm'
553553
compiler = [compiler_for(filename, force_c)]
554-
if compiler[0] == EMCC and not self.get_setting('WASMFS'):
554+
if compiler[0] == EMCC:
555555
# TODO change test behaviour in the future when WASMFS becomes default file system
556556
# WASMFS is excluded here since it currently requires stdlib++ functions
557557
# TODO(https://github.com/emscripten-core/emscripten/issues/11121)

0 commit comments

Comments
 (0)