aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-10-25 05:06:21 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2016-10-25 09:44:15 +0530
commit02a2d69270ae37fd3de0c6f2bdc33c9ad47a6517 (patch)
treec9b8d2bd6bf55f0764d57d2d9cd3013b00c79308 /mesonbuild/compilers.py
parent3c48bd2d88e94db2c9f6e714b7b320889a5dcb38 (diff)
downloadmeson-02a2d69270ae37fd3de0c6f2bdc33c9ad47a6517.zip
meson-02a2d69270ae37fd3de0c6f2bdc33c9ad47a6517.tar.gz
meson-02a2d69270ae37fd3de0c6f2bdc33c9ad47a6517.tar.bz2
compilers: Derive ClangObj*Compiler from ClangCompiler too
The Clang ObjC/++ compiler is the same as the C/++ compiler.
Diffstat (limited to 'mesonbuild/compilers.py')
-rw-r--r--mesonbuild/compilers.py31
1 files changed, 10 insertions, 21 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index b7613aa..f03e34d 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -2071,6 +2071,9 @@ class ClangCompiler():
raise MesonException('Unreachable code when converting clang type to gcc type.')
return get_gcc_soname_args(gcc_type, prefix, shlib_name, suffix, path, soversion)
+ def has_argument(self, arg, env):
+ return super().has_argument(['-Werror=unknown-warning-option', arg], env)
+
class ClangCCompiler(ClangCompiler, CCompiler):
def __init__(self, exelist, version, clang_type, is_cross, exe_wrapper=None):
CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper)
@@ -2096,11 +2099,8 @@ class ClangCCompiler(ClangCompiler, CCompiler):
def get_option_link_args(self, options):
return []
- def has_argument(self, arg, env):
- return super().has_argument(['-Werror=unknown-warning-option', arg], env)
-
-class ClangCPPCompiler(ClangCompiler, CPPCompiler):
+class ClangCPPCompiler(ClangCompiler, CPPCompiler):
def __init__(self, exelist, version, cltype, is_cross, exe_wrapper=None):
CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrapper)
ClangCompiler.__init__(self, cltype)
@@ -2123,28 +2123,17 @@ class ClangCPPCompiler(ClangCompiler, CPPCompiler):
def get_option_link_args(self, options):
return []
- def has_argument(self, arg, env):
- return super().has_argument(['-Werror=unknown-warning-option', arg], env)
-
-class ClangObjCCompiler(GnuObjCCompiler):
+class ClangObjCCompiler(ClangCompiler, GnuObjCCompiler):
def __init__(self, exelist, version, cltype, is_cross, exe_wrapper=None):
- super().__init__(exelist, version, is_cross, exe_wrapper)
- self.id = 'clang'
+ GnuObjCCompiler.__init__(self, exelist, version, is_cross, exe_wrapper)
+ ClangCompiler.__init__(self, cltype)
self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage']
- self.clang_type = cltype
- if self.clang_type != CLANG_OSX:
- self.base_options.append('b_lundef')
- self.base_options.append('b_asneeded')
-class ClangObjCPPCompiler(GnuObjCPPCompiler):
+class ClangObjCPPCompiler(ClangCompiler, GnuObjCPPCompiler):
def __init__(self, exelist, version, cltype, is_cross, exe_wrapper=None):
- super().__init__(exelist, version, is_cross, exe_wrapper)
- self.id = 'clang'
- self.clang_type = cltype
+ GnuObjCPPCompiler.__init__(self, exelist, version, is_cross, exe_wrapper)
+ ClangCompiler.__init__(self, cltype)
self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage']
- if self.clang_type != CLANG_OSX:
- self.base_options.append('b_lundef')
- self.base_options.append('b_asneeded')
class FortranCompiler(Compiler):
def __init__(self, exelist, version, is_cross, exe_wrapper=None):