Skip to content

Commit 1503fed

Browse files
committed
embind: Ignore single file option for TS generation.
Another setting we can ignore during TS generation to avoid errors.
1 parent 1375c03 commit 1503fed

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

emcc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3297,12 +3297,13 @@ def phase_embind_emit_tsd(options, in_wasm, wasm_target, memfile, js_syms):
32973297
# import names.
32983298
settings.MINIFY_WASM_IMPORTED_MODULES = False
32993299
setup_environment_settings()
3300+
# Use a separate Wasm file so the JS does not need to be modified after emscripten.run.
3301+
settings.SINGLE_FILE = False
33003302
# Embind may be included multiple times, de-duplicate the list first.
33013303
settings.JS_LIBRARIES = dedup_list(settings.JS_LIBRARIES)
33023304
# Replace embind with the TypeScript generation version.
33033305
embind_index = settings.JS_LIBRARIES.index('embind/embind.js')
33043306
settings.JS_LIBRARIES[embind_index] = 'embind/embind_ts.js'
3305-
33063307
outfile_js = in_temp('tsgen_a.out.js')
33073308
# The Wasm outfile may be modified by emscripten.run, so use a temporary file.
33083309
outfile_wasm = in_temp('tsgen_a.out.wasm')

test/test_other.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3011,6 +3011,7 @@ def test_embind_tsgen_ignore(self):
30113011
'-sUSE_PTHREADS',
30123012
'-sPROXY_TO_PTHREAD',
30133013
'-sPTHREAD_POOL_SIZE=1',
3014+
'-sSINGLE_FILE=1',
30143015
'-lembind', # Test duplicated link option.
30153016
]
30163017
self.run_process([EMCC, test_file('other/embind_tsgen.cpp'),

0 commit comments

Comments
 (0)