aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-03-18 00:36:39 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2016-03-18 00:36:39 +0200
commitae1f284ade322f28b2efdf7abaef2543949f31d3 (patch)
tree82866a3e6d262582b68463b1a8f979edc3700ddf /mesonbuild/compilers.py
parent90c799fc610f2955d08e84c053ab43dd09768e20 (diff)
downloadmeson-ae1f284ade322f28b2efdf7abaef2543949f31d3.zip
meson-ae1f284ade322f28b2efdf7abaef2543949f31d3.tar.gz
meson-ae1f284ade322f28b2efdf7abaef2543949f31d3.tar.bz2
Added base options to Clang compilers.
Diffstat (limited to 'mesonbuild/compilers.py')
-rw-r--r--mesonbuild/compilers.py29
1 files changed, 25 insertions, 4 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index 4bb0d83..2c35c67 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -1348,6 +1348,11 @@ GCC_STANDARD = 0
GCC_OSX = 1
GCC_MINGW = 2
+CLANG_STANDARD = 0
+CLANG_OSX = 1
+CLANG_WIN = 2
+# Possibly clang-cl?
+
def get_gcc_soname_args(gcc_type, shlib_name, path, soversion):
if soversion is None:
sostr = ''
@@ -1480,22 +1485,34 @@ class GnuObjCPPCompiler(ObjCPPCompiler):
return get_gcc_soname_args(self.gcc_type, shlib_name, path, soversion)
class ClangObjCCompiler(GnuObjCCompiler):
- def __init__(self, exelist, version, is_cross, exe_wrapper=None):
+ def __init__(self, exelist, version, cltype, is_cross, exe_wrapper=None):
super().__init__(exelist, version, is_cross, exe_wrapper)
self.id = 'clang'
+ self.base_options = ['b_lto', 'b_pgo', 'b_sanitize']
+ self.clang_type = cltype
+ if self.clang_type != CLANG_OSX:
+ self.base_options.append('b_lundef')
class ClangObjCPPCompiler(GnuObjCPPCompiler):
- def __init__(self, exelist, version, is_cross, exe_wrapper=None):
+ 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
+ self.base_options = ['b_lto', 'b_pgo', 'b_sanitize']
+ if self.clang_type != CLANG_OSX:
+ self.base_options.append('b_lundef')
class ClangCCompiler(CCompiler):
- def __init__(self, exelist, version, is_cross, exe_wrapper=None):
+ def __init__(self, exelist, version, clang_type, is_cross, exe_wrapper=None):
CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper)
self.id = 'clang'
+ self.clang_type = clang_type
self.warn_args = {'1': ['-Wall', '-Winvalid-pch'],
'2': ['-Wall', '-Wextra', '-Winvalid-pch'],
'3' : ['-Wall', '-Wpedantic', '-Wextra', '-Winvalid-pch']}
+ self.base_options = ['b_lto', 'b_pgo', 'b_sanitize']
+ if self.clang_type != CLANG_OSX:
+ self.base_options.append('b_lundef')
def get_buildtype_args(self, buildtype):
return gnulike_buildtype_args[buildtype]
@@ -1584,12 +1601,16 @@ class GnuCPPCompiler(CPPCompiler):
return []
class ClangCPPCompiler(CPPCompiler):
- def __init__(self, exelist, version, is_cross, exe_wrapper=None):
+ def __init__(self, exelist, version, cltype, is_cross, exe_wrapper=None):
CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrapper)
self.id = 'clang'
self.warn_args = {'1': ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor'],
'2': ['-Wall', '-Wextra', '-Winvalid-pch', '-Wnon-virtual-dtor'],
'3': ['-Wall', '-Wpedantic', '-Wextra', '-Winvalid-pch', '-Wnon-virtual-dtor']}
+ self.clang_type = cltype
+ self.base_options = ['b_lto', 'b_pgo', 'b_sanitize']
+ if self.clang_type != CLANG_OSX:
+ self.base_options.append('b_lundef')
def get_buildtype_args(self, buildtype):
return gnulike_buildtype_args[buildtype]