Skip to content

Commit 5b6bf91

Browse files
authored
Add support for -no-pthread (#20723)
Fixes: #20720
1 parent 084611f commit 5b6bf91

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

emcc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3747,6 +3747,10 @@ def consume_arg_file():
37473747
settings.PTHREADS = 1
37483748
# Also set the legacy setting name, in case use JS code depends on it.
37493749
settings.USE_PTHREADS = 1
3750+
elif arg == '-no-pthread':
3751+
settings.PTHREADS = 0
3752+
# Also set the legacy setting name, in case use JS code depends on it.
3753+
settings.USE_PTHREADS = 0
37503754
elif arg == '-pthreads':
37513755
exit_with_error('unrecognized command-line option `-pthreads`; did you mean `-pthread`?')
37523756
elif arg in ('-fno-diagnostics-color', '-fdiagnostics-color=never'):

test/test_other.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14159,3 +14159,8 @@ def test_embind_no_duplicate_symbols(self):
1415914159
create_file('a.cpp', '#include <emscripten/bind.h>')
1416014160
create_file('b.cpp', '#include <emscripten/bind.h>')
1416114161
self.run_process([EMXX, '-std=c++23', '-lembind', 'a.cpp', 'b.cpp'])
14162+
14163+
def test_no_pthread(self):
14164+
self.do_runf('hello_world.c', emcc_args=['-pthread', '-no-pthread'])
14165+
self.assertExists('hello_world.js')
14166+
self.assertNotExists('hello_world.worker.js')

0 commit comments

Comments
 (0)