Fix nasm when target has threads as added dependency

pull/11308/head
Gijs Peskens 2 years ago committed by Xavier Claessens
parent 7b59a2e3ea
commit 5a4168c410
  1. 8
      mesonbuild/compilers/asm.py
  2. 12
      test cases/nasm/2 asm language/meson.build

@ -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]

@ -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)

Loading…
Cancel
Save