summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/detect.py
diff options
context:
space:
mode:
authorNomura <nomura.rh@gmail.com>2023-04-26 21:29:59 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2023-05-06 19:57:06 +0300
commitc1fce8f60f3cbbdf72fb3b987f1d07c86b292c82 (patch)
tree3914f5a723613bc1e6bf1e2631c1705c1870d586 /mesonbuild/compilers/detect.py
parent1958ded04f2f072571e86bbd5e805c06a4b89704 (diff)
downloadmeson-c1fce8f60f3cbbdf72fb3b987f1d07c86b292c82.tar.gz
Initial support for Metrowerks Assembler
Diffstat (limited to 'mesonbuild/compilers/detect.py')
-rw-r--r--mesonbuild/compilers/detect.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py
index a700cfd60..1237cacb7 100644
--- a/mesonbuild/compilers/detect.py
+++ b/mesonbuild/compilers/detect.py
@@ -1216,7 +1216,7 @@ def detect_swift_compiler(env: 'Environment', for_machine: MachineChoice) -> Com
raise EnvironmentException('Unknown compiler: ' + join_args(exelist))
def detect_nasm_compiler(env: 'Environment', for_machine: MachineChoice) -> Compiler:
- from .asm import NasmCompiler, YasmCompiler
+ from .asm import NasmCompiler, YasmCompiler, MetrowerksAsmCompilerARM, MetrowerksAsmCompilerEmbeddedPowerPC
compilers, _, _ = _get_compilers(env, 'nasm', for_machine)
is_cross = env.is_cross_build(for_machine)
@@ -1249,6 +1249,16 @@ def detect_nasm_compiler(env: 'Environment', for_machine: MachineChoice) -> Comp
comp_class = YasmCompiler
env.coredata.add_lang_args(comp_class.language, comp_class, for_machine, env)
return comp_class([], comp, version, for_machine, info, cc.linker, is_cross=is_cross)
+ elif 'Metrowerks' in output or 'Freescale' in output:
+ if 'ARM' in output:
+ comp_class_mwasmarm = MetrowerksAsmCompilerARM
+ env.coredata.add_lang_args(comp_class_mwasmarm.language, comp_class_mwasmarm, for_machine, env)
+ return comp_class_mwasmarm([], comp, version, for_machine, info, cc.linker, is_cross=is_cross)
+ else:
+ comp_class_mwasmeppc = MetrowerksAsmCompilerEmbeddedPowerPC
+ env.coredata.add_lang_args(comp_class_mwasmeppc.language, comp_class_mwasmeppc, for_machine, env)
+ return comp_class_mwasmeppc([], comp, version, for_machine, info, cc.linker, is_cross=is_cross)
+
_handle_exceptions(popen_exceptions, compilers)
raise EnvironmentException('Unreachable code (exception to make mypy happy)')