Skip to content

embind: Ignore single file option for TS generation. #20632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
1 change: 1 addition & 0 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down