Skip to content

Commit 9583e77

Browse files
committed
Inject compiler flags as part of get_clang_flags. NFC
I noticed these were a little out-of-place in emscripten-core#22751
1 parent 257b7d5 commit 9583e77

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

emcc.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,15 @@ def get_clang_flags(user_args):
375375
if settings.INLINING_LIMIT:
376376
flags.append('-fno-inline-functions')
377377

378+
if settings.PTHREADS:
379+
if '-pthread' not in user_args:
380+
flags.append('-pthread')
381+
elif settings.SHARED_MEMORY:
382+
if '-matomics' not in user_args:
383+
flags.append('-matomics')
384+
if '-mbulk-memory' not in user_args:
385+
flags.append('-mbulk-memory')
386+
378387
if settings.RELOCATABLE and '-fPIC' not in user_args:
379388
flags.append('-fPIC')
380389

@@ -842,14 +851,6 @@ def phase_setup(options, state, newargs):
842851
if settings.PTHREADS or settings.WASM_WORKERS:
843852
settings.SHARED_MEMORY = 1
844853

845-
if settings.PTHREADS and '-pthread' not in newargs:
846-
newargs += ['-pthread']
847-
elif settings.SHARED_MEMORY:
848-
if '-matomics' not in newargs:
849-
newargs += ['-matomics']
850-
if '-mbulk-memory' not in newargs:
851-
newargs += ['-mbulk-memory']
852-
853854
if settings.SHARED_MEMORY:
854855
settings.BULK_MEMORY = 1
855856

0 commit comments

Comments
 (0)