emscripten: prefer `-pthread` over `-s USE_PTHREADS=1`

See: https://github.com/emscripten-core/emscripten/issues/12346

This is supported since Emscripten 1.38.33, see:
24350798a8
pull/11219/head
Kleis Auke Wolthuizen 4 years ago committed by Eli Schwartz
parent 891b4ffe33
commit 898e85d847
  1. 4
      mesonbuild/compilers/mixins/emscripten.py

@ -59,10 +59,10 @@ class EmscriptenMixin(Compiler):
return os.path.join(dirname, 'output.' + suffix) return os.path.join(dirname, 'output.' + suffix)
def thread_flags(self, env: 'Environment') -> T.List[str]: def thread_flags(self, env: 'Environment') -> T.List[str]:
return ['-s', 'USE_PTHREADS=1'] return ['-pthread']
def thread_link_flags(self, env: 'Environment') -> T.List[str]: def thread_link_flags(self, env: 'Environment') -> T.List[str]:
args = ['-s', 'USE_PTHREADS=1'] args = ['-pthread']
count: int = env.coredata.options[OptionKey('thread_count', lang=self.language, machine=self.for_machine)].value count: int = env.coredata.options[OptionKey('thread_count', lang=self.language, machine=self.for_machine)].value
if count: if count:
args.extend(['-s', f'PTHREAD_POOL_SIZE={count}']) args.extend(['-s', f'PTHREAD_POOL_SIZE={count}'])

Loading…
Cancel
Save