From 4401668c9ac8c42d2e8633e32d168a2c5e1b0ee8 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 14 Sep 2020 14:36:47 -0700 Subject: [PATCH] linkers/compilers: Move an emscripten method to the compiler This needed an attribute the linker doesn't have. --- mesonbuild/compilers/mixins/emscripten.py | 7 +++++++ mesonbuild/linkers.py | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mesonbuild/compilers/mixins/emscripten.py b/mesonbuild/compilers/mixins/emscripten.py index 10f4b25cc..08b220528 100644 --- a/mesonbuild/compilers/mixins/emscripten.py +++ b/mesonbuild/compilers/mixins/emscripten.py @@ -41,6 +41,13 @@ class EmscriptenMixin: def thread_flags(self, env: 'Environment') -> T.List[str]: return ['-s', 'USE_PTHREADS=1'] + def thread_link_flags(self, env: 'Environment') -> T.List[str]: + args = ['-s', 'USE_PTHREADS=1'] + count = env.coredata.compiler_options[self.for_machine]['{}_thread_count'.format(self.language)].value # type: int + if count: + args.extend(['-s', 'PTHREAD_POOL_SIZE={}'.format(count)]) + return args + def get_options(self): opts = super().get_options() opts.update({ diff --git a/mesonbuild/linkers.py b/mesonbuild/linkers.py index 54c81b4f3..fa8b32641 100644 --- a/mesonbuild/linkers.py +++ b/mesonbuild/linkers.py @@ -780,13 +780,6 @@ class WASMDynamicLinker(GnuLikeDynamicLinkerMixin, PosixDynamicLinkerMixin, Dyna id = 'ld.wasm' - def thread_link_flags(self, env: 'Environment') -> T.List[str]: - args = ['-s', 'USE_PTHREADS=1'] - count = env.coredata.compiler_options[self.for_machine]['{}_thread_count'.format(self.language)].value # type: int - if count: - args.extend(['-s', 'PTHREAD_POOL_SIZE={}'.format(count)]) - return args - def get_allow_undefined_args(self) -> T.List[str]: return ['-s', 'ERROR_ON_UNDEFINED_SYMBOLS=0']