aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
diff options
context:
space:
mode:
authorStepan Nassyr <s.nassyr@fz-juelich.de>2022-06-09 20:54:22 +0200
committerDylan Baker <dylan@pnwbakers.com>2022-06-10 08:24:52 -0700
commitd045c9f79df629d8111ed46c2afeb37670bb8309 (patch)
tree505fdc3ac4fb4e400e244a4a840711d3f7ca7cb2 /mesonbuild/compilers
parenta49cd00d644c8adce974175850c047056d578b05 (diff)
downloadmeson-d045c9f79df629d8111ed46c2afeb37670bb8309.zip
meson-d045c9f79df629d8111ed46c2afeb37670bb8309.tar.gz
meson-d045c9f79df629d8111ed46c2afeb37670bb8309.tar.bz2
Allow for 3-component ACfL versions
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r--mesonbuild/compilers/detect.py34
1 files changed, 26 insertions, 8 deletions
diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py
index 05ae86f..79bc2b5 100644
--- a/mesonbuild/compilers/detect.py
+++ b/mesonbuild/compilers/detect.py
@@ -477,11 +477,20 @@ def _detect_c_or_cpp_compiler(env: 'Environment', lang: str, for_machine: Machin
exe_wrap, linker=linker, full_version=full_version)
if 'Arm C/C++/Fortran Compiler' in out:
+ version = ''
arm_ver_match = re.search(r'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 arm_ver_match:
+ 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])
+ else:
+ arm_ver_match = re.search(r'version (\d+)\.(\d+)\.(\d+) \(build number (\d+)\)', out)
+ arm_ver_major = arm_ver_match.group(1)
+ arm_ver_minor = arm_ver_match.group(2)
+ arm_ver_patch = arm_ver_match.group(3)
+ arm_ver_build = arm_ver_match.group(4)
+ version = '.'.join([arm_ver_major, arm_ver_minor, arm_ver_patch, arm_ver_build])
if lang == 'c':
cls = ArmLtdClangCCompiler
elif lang == 'cpp':
@@ -747,11 +756,20 @@ def detect_fortran_compiler(env: 'Environment', for_machine: MachineChoice) -> C
if 'Arm C/C++/Fortran Compiler' in out:
cls = ArmLtdFlangFortranCompiler
+ version = ''
arm_ver_match = re.search(r'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 arm_ver_match:
+ 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])
+ else:
+ arm_ver_match = re.search(r'version (\d+)\.(\d+)\.(\d+) \(build number (\d+)\)', out)
+ arm_ver_major = arm_ver_match.group(1)
+ arm_ver_minor = arm_ver_match.group(2)
+ arm_ver_patch = arm_ver_match.group(3)
+ arm_ver_build = arm_ver_match.group(4)
+ version = '.'.join([arm_ver_major, arm_ver_minor, arm_ver_patch, arm_ver_build])
linker = guess_nix_linker(env, compiler, cls, version, for_machine)
return cls(
ccache + compiler, version, for_machine, is_cross, info,