aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-10-07 18:53:59 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2016-10-14 19:13:21 +0530
commit4332df01b86d5648c83498561572161d1f50e4cd (patch)
treee303c5c08f90cc074b626cc84d9dba236234bdf1 /mesonbuild/compilers.py
parentb6b8d561b84eb950d1503e682ca2eab3b656efa9 (diff)
downloadmeson-4332df01b86d5648c83498561572161d1f50e4cd.zip
meson-4332df01b86d5648c83498561572161d1f50e4cd.tar.gz
meson-4332df01b86d5648c83498561572161d1f50e4cd.tar.bz2
Add no-warning args while building Vala C code
This is done by adding a new compiler method called 'no_warn_args' which returns the argument(s) required for the compiler to emit no warnings for that compilation. This take care of not disabling warnings for C code compiled into the BuildTarget. Also includes tests for ensuring all this. https://github.com/mesonbuild/meson/issues/864
Diffstat (limited to 'mesonbuild/compilers.py')
-rw-r--r--mesonbuild/compilers.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index 68157bd..6ad2f1e 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -473,6 +473,10 @@ class CCompiler(Compiler):
def get_warn_args(self, level):
return self.warn_args[level]
+ def get_no_warn_args(self):
+ # Almost every compiler uses this for disabling warnings
+ return ['-w']
+
def get_soname_args(self, prefix, shlib_name, suffix, path, soversion):
return []
@@ -2255,6 +2259,9 @@ end program prog
def get_warn_args(self, level):
return ['-Wall']
+ def get_no_warn_args(self):
+ return ['-w']
+
class GnuFortranCompiler(FortranCompiler):
def __init__(self, exelist, version, gcc_type, is_cross, exe_wrapper=None, defines=None):
@@ -2292,6 +2299,10 @@ class G95FortranCompiler(FortranCompiler):
def get_always_args(self):
return ['-pipe']
+ def get_no_warn_args(self):
+ # FIXME: Confirm that there's no compiler option to disable all warnings
+ return []
+
def gen_import_library_args(self, implibname):
"""
The name of the outputted import library
@@ -2357,6 +2368,9 @@ class PGIFortranCompiler(FortranCompiler):
def get_warn_args(self, level):
return PGIFortranCompiler.std_warn_args
+ def get_no_warn_args(self):
+ return ['-silent']
+
class Open64FortranCompiler(FortranCompiler):
std_warn_args = ['-fullwarn']