aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-09-10 17:07:18 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2016-09-10 17:07:18 +0300
commit26f9adf6a6b184def445dae1c9c2f8587cdd3320 (patch)
tree30ef1949a34f9d97560c8d2f65638a59c93d45e7
parent5833d23e7643c07f9c50843414032ae2e2d4094e (diff)
downloadmeson-26f9adf6a6b184def445dae1c9c2f8587cdd3320.zip
meson-26f9adf6a6b184def445dae1c9c2f8587cdd3320.tar.gz
meson-26f9adf6a6b184def445dae1c9c2f8587cdd3320.tar.bz2
Moved base options to base class, because they are always the same.
-rw-r--r--mesonbuild/compilers.py23
1 files changed, 5 insertions, 18 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index 4c9fd2e..99e1a41 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -1939,6 +1939,11 @@ class GnuCompiler:
def __init__(self, gcc_type):
self.id = 'gcc'
self.gcc_type = gcc_type
+ self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage',
+ 'b_colorout']
+ if self.gcc_type != GCC_OSX:
+ self.base_options.append('b_lundef')
+ self.base_options.append('b_asneeded')
def get_colorout_args(self, colortype):
if mesonlib.version_compare(self.version, '>=4.9.0'):
@@ -1975,11 +1980,6 @@ class GnuCCompiler(GnuCompiler, CCompiler):
self.warn_args = {'1': ['-Wall', '-Winvalid-pch'],
'2': ['-Wall', '-Wextra', '-Winvalid-pch'],
'3' : ['-Wall', '-Wpedantic', '-Wextra', '-Winvalid-pch']}
- self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage',
- 'b_colorout']
- if self.gcc_type != GCC_OSX:
- self.base_options.append('b_lundef')
- self.base_options.append('b_asneeded')
def can_compile(self, filename):
return super().can_compile(filename) or filename.split('.')[-1].lower() == 's' # Gcc can do asm, too.
@@ -2015,11 +2015,6 @@ class GnuCPPCompiler(GnuCompiler, CPPCompiler):
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.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage',
- 'b_colorout']
- if self.gcc_type != GCC_OSX:
- self.base_options.append('b_lundef')
- self.base_options.append('b_asneeded')
def get_options(self):
opts = {'cpp_std' : coredata.UserComboOption('cpp_std', 'C++ language standard to use',
@@ -2060,10 +2055,6 @@ class GnuObjCCompiler(GnuCompiler,ObjCCompiler):
self.warn_args = {'1': ['-Wall', '-Winvalid-pch'],
'2': ['-Wall', '-Wextra', '-Winvalid-pch'],
'3' : ['-Wall', '-Wpedantic', '-Wextra', '-Winvalid-pch']}
- self.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage']
- if self.gcc_type != GCC_OSX:
- self.base_options.append('b_lundef')
- self.base_options.append('b_asneeded')
class GnuObjCPPCompiler(GnuCompiler, ObjCPPCompiler):
@@ -2075,10 +2066,6 @@ class GnuObjCPPCompiler(GnuCompiler, ObjCPPCompiler):
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.base_options = ['b_pch', 'b_lto', 'b_pgo', 'b_sanitize', 'b_coverage']
- if self.gcc_type != GCC_OSX:
- self.base_options.append('b_lundef')
- self.base_options.append('b_asneeded')
class ClangObjCCompiler(GnuObjCCompiler):
def __init__(self, exelist, version, cltype, is_cross, exe_wrapper=None):