diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2022-03-09 12:34:04 -0500 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2022-10-24 11:06:57 +0200 |
commit | d29ef2b128c651fa83f1d923290d66cc8eb63223 (patch) | |
tree | 73aae2279a382fc719d0bb8a0e9b40740922a8e0 /mesonbuild/compilers/asm.py | |
parent | 01ee14133906e4afa55cdc52eeb1c9e78bbeced5 (diff) | |
download | meson-d29ef2b128c651fa83f1d923290d66cc8eb63223.zip meson-d29ef2b128c651fa83f1d923290d66cc8eb63223.tar.gz meson-d29ef2b128c651fa83f1d923290d66cc8eb63223.tar.bz2 |
Add yasm as fallback for nasm language
Diffstat (limited to 'mesonbuild/compilers/asm.py')
-rw-r--r-- | mesonbuild/compilers/asm.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/mesonbuild/compilers/asm.py b/mesonbuild/compilers/asm.py index 52ff779..4135a5b 100644 --- a/mesonbuild/compilers/asm.py +++ b/mesonbuild/compilers/asm.py @@ -1,7 +1,7 @@ import os import typing as T -from ..mesonlib import EnvironmentException +from ..mesonlib import EnvironmentException, get_meson_command from .compilers import Compiler if T.TYPE_CHECKING: @@ -75,3 +75,21 @@ class NasmCompiler(Compiler): if i[:2] == '-I': parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:])) return parameter_list + +class YasmCompiler(NasmCompiler): + id = 'yasm' + + def get_exelist(self) -> T.List[str]: + # Wrap yasm executable with an internal script that will write depfile. + exelist = super().get_exelist() + return get_meson_command() + ['--internal', 'yasm'] + exelist + + def get_debug_args(self, is_debug: bool) -> T.List[str]: + if is_debug: + if self.info.is_windows(): + return ['-g', 'null'] + return ['-g', 'dwarf2'] + return [] + + def get_dependency_gen_args(self, outtarget: str, outfile: str) -> T.List[str]: + return ['--depfile', outfile] |