summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2025-09-25 13:42:22 -0700
committerDylan Baker <dylan@pnwbakers.com>2025-10-06 09:03:07 -0700
commit1e254ad7f327e5ed2021463e4b66c37072d354e3 (patch)
tree94cd596b10d58a2ab71773579cff23f991ea55c7
parent3d66942efd407bde8da13e92be89cba97c5def97 (diff)
downloadmeson-1e254ad7f327e5ed2021463e4b66c37072d354e3.tar.gz
compilers/asm: Introduce an ASMCompiler base class
This will be able to hold some shared state between the different ASM compilers (or should that be assemblers?)
-rw-r--r--mesonbuild/compilers/asm.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/mesonbuild/compilers/asm.py b/mesonbuild/compilers/asm.py
index d358ca992..de5925df8 100644
--- a/mesonbuild/compilers/asm.py
+++ b/mesonbuild/compilers/asm.py
@@ -26,7 +26,12 @@ nasm_optimization_args: T.Dict[str, T.List[str]] = {
}
-class NasmCompiler(Compiler):
+class ASMCompiler(Compiler):
+
+ """Shared base class for all ASM Compilers (Assemblers)"""
+
+
+class NasmCompiler(ASMCompiler):
language = 'nasm'
id = 'nasm'
@@ -152,7 +157,7 @@ class YasmCompiler(NasmCompiler):
return ['--depfile', outfile]
# https://learn.microsoft.com/en-us/cpp/assembler/masm/ml-and-ml64-command-line-reference
-class MasmCompiler(Compiler):
+class MasmCompiler(ASMCompiler):
language = 'masm'
id = 'ml'
@@ -210,7 +215,7 @@ class MasmCompiler(Compiler):
# https://learn.microsoft.com/en-us/cpp/assembler/arm/arm-assembler-command-line-reference
-class MasmARMCompiler(Compiler):
+class MasmARMCompiler(ASMCompiler):
language = 'masm'
id = 'armasm'
@@ -261,14 +266,14 @@ class MasmARMCompiler(Compiler):
# https://downloads.ti.com/docs/esd/SPRUI04/
-class TILinearAsmCompiler(TICompiler, Compiler):
+class TILinearAsmCompiler(TICompiler, ASMCompiler):
language = 'linearasm'
def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str,
for_machine: MachineChoice, info: MachineInfo,
linker: T.Optional[DynamicLinker] = None,
full_version: T.Optional[str] = None, is_cross: bool = False):
- Compiler.__init__(self, ccache, exelist, version, for_machine, info, linker, full_version, is_cross)
+ ASMCompiler.__init__(self, ccache, exelist, version, for_machine, info, linker, full_version, is_cross)
TICompiler.__init__(self)
def needs_static_linker(self) -> bool:
@@ -288,14 +293,14 @@ class TILinearAsmCompiler(TICompiler, Compiler):
return 'd'
-class MetrowerksAsmCompiler(MetrowerksCompiler, Compiler):
+class MetrowerksAsmCompiler(MetrowerksCompiler, ASMCompiler):
language = 'nasm'
def __init__(self, ccache: T.List[str], exelist: T.List[str], version: str,
for_machine: 'MachineChoice', info: 'MachineInfo',
linker: T.Optional['DynamicLinker'] = None,
full_version: T.Optional[str] = None, is_cross: bool = False):
- Compiler.__init__(self, ccache, exelist, version, for_machine, info, linker, full_version, is_cross)
+ ASMCompiler.__init__(self, ccache, exelist, version, for_machine, info, linker, full_version, is_cross)
MetrowerksCompiler.__init__(self)
self.warn_args: T.Dict[str, T.List[str]] = {