aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammed Amer Khalidi <mohammedamer.khalidi@cirrus.com>2018-09-28 11:59:51 +0530
committerJussi Pakkanen <jpakkane@gmail.com>2018-10-07 19:21:26 +0300
commit18204b8ed6a19c4ac8b2405da87513b878282f45 (patch)
treefc445d79b0593163662c1be815707756ad8d5449
parentc0236e10f36448703ca2f85689aaa880810d93c6 (diff)
downloadmeson-18204b8ed6a19c4ac8b2405da87513b878282f45.zip
meson-18204b8ed6a19c4ac8b2405da87513b878282f45.tar.gz
meson-18204b8ed6a19c4ac8b2405da87513b878282f45.tar.bz2
Adding "compiler_type" flag to ARM compilers.
-rw-r--r--mesonbuild/compilers/c.py8
-rw-r--r--mesonbuild/compilers/compilers.py10
-rw-r--r--mesonbuild/compilers/cpp.py8
-rw-r--r--mesonbuild/environment.py6
4 files changed, 19 insertions, 13 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index 73721e4..b523d40 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -1137,9 +1137,9 @@ class ClangCCompiler(ClangCompiler, CCompiler):
class ArmclangCCompiler(ArmclangCompiler, CCompiler):
- def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwargs):
+ def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, **kwargs):
CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs)
- ArmclangCompiler.__init__(self)
+ ArmclangCompiler.__init__(self, compiler_type)
default_warn_args = ['-Wall', '-Winvalid-pch']
self.warn_args = {'1': default_warn_args,
'2': default_warn_args + ['-Wextra'],
@@ -1545,9 +1545,9 @@ class VisualStudioCCompiler(CCompiler):
class ArmCCompiler(ArmCompiler, CCompiler):
- def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwargs):
+ def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, **kwargs):
CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs)
- ArmCompiler.__init__(self)
+ ArmCompiler.__init__(self, compiler_type)
def get_options(self):
opts = CCompiler.get_options(self)
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 26aeba7..97bfa38 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -1191,6 +1191,8 @@ class CompilerType(enum.Enum):
ICC_OSX = 21
ICC_WIN = 22
+ ARM_WIN = 30
+
@property
def is_standard_compiler(self):
return self.name in ('GCC_STANDARD', 'CLANG_STANDARD', 'ICC_STANDARD')
@@ -1201,7 +1203,7 @@ class CompilerType(enum.Enum):
@property
def is_windows_compiler(self):
- return self.name in ('GCC_MINGW', 'GCC_CYGWIN', 'CLANG_MINGW', 'ICC_WIN')
+ return self.name in ('GCC_MINGW', 'GCC_CYGWIN', 'CLANG_MINGW', 'ICC_WIN', 'ARM_WIN')
def get_macos_dylib_install_name(prefix, shlib_name, suffix, soversion):
@@ -1542,7 +1544,7 @@ class ClangCompiler(GnuLikeCompiler):
class ArmclangCompiler:
- def __init__(self):
+ def __init__(self, compiler_type):
if not self.is_cross:
raise EnvironmentException('armclang supports only cross-compilation.')
# Check whether 'armlink.exe' is available in path
@@ -1568,6 +1570,7 @@ class ArmclangCompiler:
if not version_compare(self.version, '==' + linker_ver):
raise EnvironmentException('armlink version does not match with compiler version')
self.id = 'armclang'
+ self.compiler_type = compiler_type
self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage',
'b_ndebug', 'b_staticpic', 'b_colorout']
# Assembly
@@ -1654,10 +1657,11 @@ class IntelCompiler(GnuLikeCompiler):
class ArmCompiler:
# Functionality that is common to all ARM family compilers.
- def __init__(self):
+ def __init__(self, compiler_type):
if not self.is_cross:
raise EnvironmentException('armcc supports only cross-compilation.')
self.id = 'arm'
+ self.compiler_type = compiler_type
default_warn_args = []
self.warn_args = {'1': default_warn_args,
'2': default_warn_args + [],
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py
index c68c529..dd0b27f 100644
--- a/mesonbuild/compilers/cpp.py
+++ b/mesonbuild/compilers/cpp.py
@@ -157,9 +157,9 @@ class ClangCPPCompiler(ClangCompiler, CPPCompiler):
class ArmclangCPPCompiler(ArmclangCompiler, CPPCompiler):
- def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwargs):
+ def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, **kwargs):
CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs)
- ArmclangCompiler.__init__(self)
+ ArmclangCompiler.__init__(self, compiler_type)
default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor']
self.warn_args = {'1': default_warn_args,
'2': default_warn_args + ['-Wextra'],
@@ -336,9 +336,9 @@ class VisualStudioCPPCompiler(VisualStudioCCompiler, CPPCompiler):
class ArmCPPCompiler(ArmCompiler, CPPCompiler):
- def __init__(self, exelist, version, is_cross, exe_wrap=None, **kwargs):
+ def __init__(self, exelist, version, compiler_type, is_cross, exe_wrap=None, **kwargs):
CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrap, **kwargs)
- ArmCompiler.__init__(self)
+ ArmCompiler.__init__(self, compiler_type)
def get_options(self):
opts = CPPCompiler.get_options(self)
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index f01ba38..e872ba7 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -590,8 +590,9 @@ This is probably wrong, it should always point to the native compiler.''' % evar
# Override previous values
version = search_version(arm_ver_str)
full_version = arm_ver_str
+ compiler_type = CompilerType.ARM_WIN
cls = ArmclangCCompiler if lang == 'c' else ArmclangCPPCompiler
- return cls(ccache + compiler, version, is_cross, exe_wrap, full_version=full_version)
+ return cls(ccache + compiler, version, compiler_type, is_cross, exe_wrap, full_version=full_version)
if 'clang' in out:
if 'Apple' in out or mesonlib.for_darwin(want_cross, self):
compiler_type = CompilerType.CLANG_OSX
@@ -626,8 +627,9 @@ This is probably wrong, it should always point to the native compiler.''' % evar
cls = IntelCCompiler if lang == 'c' else IntelCPPCompiler
return cls(ccache + compiler, version, compiler_type, is_cross, exe_wrap, full_version=full_version)
if 'ARM' in out:
+ compiler_type = CompilerType.ARM_WIN
cls = ArmCCompiler if lang == 'c' else ArmCPPCompiler
- return cls(ccache + compiler, version, is_cross, exe_wrap, full_version=full_version)
+ return cls(ccache + compiler, version, compiler_type, is_cross, exe_wrap, full_version=full_version)
self._handle_exceptions(popen_exceptions, compilers)
def detect_c_compiler(self, want_cross):