Skip to content

Commit a1cac4b

Browse files
committed
Fix for --embind-emit-tsd + -sMODULARIZE
Fixes: #20012
1 parent 1fdc0e0 commit a1cac4b

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
@@ -1850,7 +1850,11 @@ def phase_linker_setup(options, state, newargs):
18501850
# With this option we don't actually output the program itself only the
18511851
# TS bindings.
18521852
options.output_file = in_temp('a.out.js')
1853+
# Don't invoke the programs `main` function.
18531854
settings.INVOKE_RUN = False
1855+
# Ignore -sMODULARIZE which could otherwise effect how we run the module
1856+
# to generate the bindings.
1857+
settings.MODULARIZE = False
18541858

18551859
# options.output_file is the user-specified one, target is what we will generate
18561860
if options.output_file:

test/test_other.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2909,7 +2909,7 @@ def test_jspi_add_function(self):
29092909

29102910
def test_embind_tsgen(self):
29112911
self.run_process([EMCC, test_file('other/embind_tsgen.cpp'), '-o', 'out.html',
2912-
'-lembind', '--embind-emit-tsd', 'embind_tsgen.d.ts'])
2912+
'-sMODULARIZE', '-lembind', '--embind-emit-tsd', 'embind_tsgen.d.ts'])
29132913
actual = read_file('embind_tsgen.d.ts')
29142914
self.assertNotExists('out.html')
29152915
self.assertNotExists('out.js')

0 commit comments

Comments
 (0)