nasm, yasm: Fix debug flags for Windows and macOS

pull/11737/head
L. E. Segovia 2 years ago
parent d6a0b7a6ec
commit 7b77fa0174
  1. 13
      mesonbuild/compilers/asm.py

@ -27,6 +27,7 @@ nasm_optimization_args: T.Dict[str, T.List[str]] = {
class NasmCompiler(Compiler):
language = 'nasm'
id = 'nasm'
links_with_msvc = False
# https://learn.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features
crt_args: T.Dict[str, T.List[str]] = {
@ -44,6 +45,7 @@ class NasmCompiler(Compiler):
super().__init__(ccache, exelist, version, for_machine, info, linker, full_version, is_cross)
if 'link' in self.linker.id:
self.base_options.add(OptionKey('b_vscrt'))
self.links_with_msvc = True
def needs_static_linker(self) -> bool:
return True
@ -83,9 +85,7 @@ class NasmCompiler(Compiler):
def get_debug_args(self, is_debug: bool) -> T.List[str]:
if is_debug:
if self.info.is_windows():
return []
return ['-g', '-F', 'dwarf']
return ['-g']
return []
def get_depfile_suffix(self) -> str:
@ -138,9 +138,12 @@ class YasmCompiler(NasmCompiler):
def get_debug_args(self, is_debug: bool) -> T.List[str]:
if is_debug:
if self.info.is_windows():
if self.info.is_windows() and self.links_with_msvc:
return ['-g', 'cv8']
elif self.info.is_darwin():
return ['-g', 'null']
return ['-g', 'dwarf2']
else:
return ['-g', 'dwarf2']
return []
def get_dependency_gen_args(self, outtarget: str, outfile: str) -> T.List[str]:

Loading…
Cancel
Save