diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2021-12-16 17:09:06 -0500 |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2022-01-03 12:49:04 -0500 |
commit | f30e83efd6968eacf07ebe3f1400e06a8a529778 (patch) | |
tree | e14f358550c0f389ea64ba0b27178e456098d492 /mesonbuild/compilers/detect.py | |
parent | 786d4379824a370b3a6ea415dc48aadb3b1f9dd2 (diff) | |
download | meson-f30e83efd6968eacf07ebe3f1400e06a8a529778.zip meson-f30e83efd6968eacf07ebe3f1400e06a8a529778.tar.gz meson-f30e83efd6968eacf07ebe3f1400e06a8a529778.tar.bz2 |
armltdclang: add support for ARM Ltd.'s `armclang` toolchain
This is another toolchain also called `armclang`, but it is not a cross
compiler like Keil's `armclang`. It is essentially the same as `clang`
based on its interface and CMake's support of the toolchain.
Use an `armltd` prefix for the compiler ID.
Fixes: #7255
Diffstat (limited to 'mesonbuild/compilers/detect.py')
-rw-r--r-- | mesonbuild/compilers/detect.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py index 03c5226..572ec35 100644 --- a/mesonbuild/compilers/detect.py +++ b/mesonbuild/compilers/detect.py @@ -54,6 +54,7 @@ from .c import ( AppleClangCCompiler, ArmCCompiler, ArmclangCCompiler, + ArmLtdClangCCompiler, ClangCCompiler, ClangClCCompiler, GnuCCompiler, @@ -74,6 +75,7 @@ from .cpp import ( AppleClangCPPCompiler, ArmCPPCompiler, ArmclangCPPCompiler, + ArmLtdClangCPPCompiler, ClangCPPCompiler, ClangClCPPCompiler, GnuCPPCompiler, @@ -97,6 +99,7 @@ from .d import ( from .cuda import CudaCompiler from .fortran import ( FortranCompiler, + ArmLtdFlangFortranCompiler, G95FortranCompiler, GnuFortranCompiler, ElbrusFortranCompiler, @@ -462,6 +465,20 @@ def _detect_c_or_cpp_compiler(env: 'Environment', lang: str, for_machine: Machin ccache + compiler, version, for_machine, is_cross, info, exe_wrap, linker=linker, full_version=full_version) + if 'Arm C/C++/Fortran Compiler' in out: + arm_ver_match = re.search('version (\d+)\.(\d+) \(build number (\d+)\)', out) + arm_ver_major = arm_ver_match.group(1) + arm_ver_minor = arm_ver_match.group(2) + arm_ver_build = arm_ver_match.group(3) + version = '.'.join([arm_ver_major, arm_ver_minor, arm_ver_build]) + if lang == 'c': + cls = ArmLtdClangCCompiler + elif lang == 'cpp': + cls = ArmLtdClangCPPCompiler + linker = guess_nix_linker(env, compiler, cls, for_machine) + return cls( + ccache + compiler, version, for_machine, is_cross, info, + exe_wrap, linker=linker) if 'armclang' in out: # The compiler version is not present in the first line of output, # instead it is present in second line, startswith 'Component:'. @@ -711,6 +728,17 @@ def detect_fortran_compiler(env: 'Environment', for_machine: MachineChoice) -> C compiler, version, for_machine, is_cross, info, exe_wrap, defines, full_version=full_version, linker=linker) + if 'Arm C/C++/Fortran Compiler' in out: + cls = ArmLtdFlangFortranCompiler + arm_ver_match = re.search('version (\d+)\.(\d+) \(build number (\d+)\)', out) + arm_ver_major = arm_ver_match.group(1) + arm_ver_minor = arm_ver_match.group(2) + arm_ver_build = arm_ver_match.group(3) + version = '.'.join([arm_ver_major, arm_ver_minor, arm_ver_build]) + linker = guess_nix_linker(env, compiler, cls, for_machine) + return cls( + ccache + compiler, version, for_machine, is_cross, info, + exe_wrap, linker=linker) if 'G95' in out: cls = G95FortranCompiler linker = guess_nix_linker(env, compiler, cls, for_machine) |