From cece8cd10e2879971098a225f8a21f857a68e8a0 Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Tue, 7 Nov 2023 10:11:02 -0600 Subject: [PATCH] embind: Ignore single file option for TS generation. (#20632) Another setting we can ignore during TS generation to avoid errors. --- emcc.py | 3 ++- test/test_other.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/emcc.py b/emcc.py index 5fda8547412f..c7961efa5e59 100644 --- a/emcc.py +++ b/emcc.py @@ -3297,12 +3297,13 @@ def phase_embind_emit_tsd(options, in_wasm, wasm_target, memfile, js_syms): # import names. settings.MINIFY_WASM_IMPORTED_MODULES = False setup_environment_settings() + # Use a separate Wasm file so the JS does not need to be modified after emscripten.run. + settings.SINGLE_FILE = False # Embind may be included multiple times, de-duplicate the list first. settings.JS_LIBRARIES = dedup_list(settings.JS_LIBRARIES) # Replace embind with the TypeScript generation version. embind_index = settings.JS_LIBRARIES.index('embind/embind.js') settings.JS_LIBRARIES[embind_index] = 'embind/embind_ts.js' - outfile_js = in_temp('tsgen_a.out.js') # The Wasm outfile may be modified by emscripten.run, so use a temporary file. outfile_wasm = in_temp('tsgen_a.out.wasm') diff --git a/test/test_other.py b/test/test_other.py index 78522394e96a..2dc5a0a1c72d 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -3011,6 +3011,7 @@ def test_embind_tsgen_ignore(self): '-sUSE_PTHREADS', '-sPROXY_TO_PTHREAD', '-sPTHREAD_POOL_SIZE=1', + '-sSINGLE_FILE', '-lembind', # Test duplicated link option. ] self.run_process([EMCC, test_file('other/embind_tsgen.cpp'),