diff options
author | Gijs Peskens <gijs@peskens.net> | 2022-11-14 12:27:27 +0100 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2023-02-19 02:55:56 +0530 |
commit | b9b481ff07f9e1404c9fe210b685d150f36100db (patch) | |
tree | 838b434b2b1ba4cdaedba70fc5be8e3d279b85f5 | |
parent | 5f47dac4d3d9664a7a936af194a73e9274f16708 (diff) | |
download | meson-b9b481ff07f9e1404c9fe210b685d150f36100db.zip meson-b9b481ff07f9e1404c9fe210b685d150f36100db.tar.gz meson-b9b481ff07f9e1404c9fe210b685d150f36100db.tar.bz2 |
Fix nasm when target has threads as added dependency
-rw-r--r-- | mesonbuild/compilers/asm.py | 8 | ||||
-rw-r--r-- | test cases/nasm/2 asm language/meson.build | 12 |
2 files changed, 20 insertions, 0 deletions
diff --git a/mesonbuild/compilers/asm.py b/mesonbuild/compilers/asm.py index 6149313..231cabc 100644 --- a/mesonbuild/compilers/asm.py +++ b/mesonbuild/compilers/asm.py @@ -47,6 +47,14 @@ class NasmCompiler(Compiler): def get_output_args(self, outputname: str) -> T.List[str]: return ['-o', outputname] + def unix_args_to_native(self, args: T.List[str]) -> T.List[str]: + outargs = [] + for arg in args: + if arg == '-pthread': + continue + outargs.append(arg) + return outargs + def get_optimization_args(self, optimization_level: str) -> T.List[str]: return nasm_optimization_args[optimization_level] diff --git a/test cases/nasm/2 asm language/meson.build b/test cases/nasm/2 asm language/meson.build index 21787ff..390ffed 100644 --- a/test cases/nasm/2 asm language/meson.build +++ b/test cases/nasm/2 asm language/meson.build @@ -43,3 +43,15 @@ exe = executable('hello', 'hello.asm', link_args: link_args, ) test('hello', exe) + +#Test whether pthread dependency gets filtered out +threads = dependency('threads') + +exe2 = executable('hello_w_threads', 'hello.asm', + config_file, + nasm_args: '-DFOO', + link_args: link_args, + dependencies: [threads] +) + +test('hello_w_threads', exe2) |