From 7140afc0a86f2aae0689617fca985ef209a7c097 Mon Sep 17 00:00:00 2001 From: Vasu Penugonda <34339497+sompen@users.noreply.github.com> Date: Thu, 21 Jun 2018 03:25:39 +0530 Subject: Added ARMCLANG compiler support for C/C++ (#3717) --- mesonbuild/compilers/compilers.py | 80 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) (limited to 'mesonbuild/compilers/compilers.py') diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 45caf55..21aab11 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -131,6 +131,12 @@ gnulike_buildtype_args = {'plain': [], 'release': ['-O3'], 'minsize': ['-Os', '-g']} +armclang_buildtype_args = {'plain': [], + 'debug': ['-O0', '-g'], + 'debugoptimized': ['-O1', '-g'], + 'release': ['-Os'], + 'minsize': ['-Oz']} + arm_buildtype_args = {'plain': [], 'debug': ['-O0', '--debug'], 'debugoptimized': ['-O1', '--debug'], @@ -1414,6 +1420,80 @@ class ClangCompiler: return [] +class ArmclangCompiler: + def __init__(self): + if not self.is_cross: + raise EnvironmentException('armclang supports only cross-compilation.') + # Check whether 'armlink.exe' is available in path + self.linker_exe = 'armlink.exe' + args = '--vsn' + try: + p, stdo, stderr = Popen_safe(self.linker_exe, args) + except OSError as e: + err_msg = 'Unknown linker\nRunning "{0}" gave \n"{1}"'.format(' '.join([self.linker_exe] + [args]), e) + raise EnvironmentException(err_msg) + # Verify the armlink version + ver_str = re.search('.*Component.*', stdo) + if ver_str: + ver_str = ver_str.group(0) + else: + EnvironmentException('armlink version string not found') + # Using the regular expression from environment.search_version, + # which is used for searching compiler version + version_regex = '(?