Skip to content
Closed
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
7 changes: 2 additions & 5 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -14429,12 +14429,9 @@ def test_cpp_module(self):
self.run_process([EMXX, '-std=c++20', test_file('other/hello_world.cppm'), '--precompile', '-o', 'hello_world.pcm'])
self.do_other_test('test_cpp_module.cpp', cflags=['-std=c++20', '-fprebuilt-module-path=.', 'hello_world.pcm'])

@crossplatform
def test_pthreads_flag(self):
# We support just the singular form of `-pthread`, like gcc
# Clang supports the plural form too but I think just due to historical accident:
# See https://github.com/llvm/llvm-project/commit/c800391fb974cdaaa62bd74435f76408c2e5ceae
self.assert_fail([EMCC, '-pthreads', '-c', test_file('hello_world.c')], 'emcc: error: unrecognized command-line option `-pthreads`; did you mean `-pthread`?')
# Test support for plural `-pthreads` flag
self.do_runf_out_file('hello_world.c', cflags=['-pthreads'])

def test_missing_struct_info(self):
create_file('lib.js', '''
Expand Down
4 changes: 1 addition & 3 deletions tools/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,16 +537,14 @@ def consume_arg_file():
options.openmp = 1
settings.PTHREADS = 1
settings.USE_PTHREADS = 1
elif arg == '-pthread':
elif arg in {'-pthread', '-pthreads'}:
settings.PTHREADS = 1
# Also set the legacy setting name, in case use JS code depends on it.
settings.USE_PTHREADS = 1
elif arg == '-no-pthread':
settings.PTHREADS = 0
# Also set the legacy setting name, in case use JS code depends on it.
settings.USE_PTHREADS = 0
elif arg == '-pthreads':
exit_with_error('unrecognized command-line option `-pthreads`; did you mean `-pthread`?')
elif arg == '-fno-rtti':
settings.USE_RTTI = 0
elif arg == '-frtti':
Expand Down
Loading