diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2015-04-04 00:31:06 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2015-04-04 00:31:06 +0300 |
commit | a4a3ba139b7b48cb8416fd53875b29cdf3bbcd92 (patch) | |
tree | 836b25f8da6bacd2a2b5e1d5b74ffdc5f4e06d8e | |
parent | 67fdfd5d05ac462762fd025e6b27786bb1c6dcd6 (diff) | |
download | meson-a4a3ba139b7b48cb8416fd53875b29cdf3bbcd92.zip meson-a4a3ba139b7b48cb8416fd53875b29cdf3bbcd92.tar.gz meson-a4a3ba139b7b48cb8416fd53875b29cdf3bbcd92.tar.bz2 |
Use -pedantic instead of -Wpedantic on old GCC versions.
-rw-r--r-- | compilers.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/compilers.py b/compilers.py index 9b9c2c8..61a2372 100644 --- a/compilers.py +++ b/compilers.py @@ -1003,12 +1003,18 @@ def get_gcc_soname_args(gcc_type, shlib_name, path, soversion): raise RuntimeError('Not impelented yet.') class GnuCCompiler(CCompiler): - std_warn_args = ['-Wall', '-Wpedantic', '-Winvalid-pch'] + std_warn_args = [] + old_warn = ['-Wall', '-pedantic', '-Winvalid-pch'] + new_warn = ['-Wall', '-Wpedantic', '-Winvalid-pch'] def __init__(self, exelist, version, gcc_type, is_cross, exe_wrapper=None): CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper) self.id = 'gcc' self.gcc_type = gcc_type + if mesonlib.version_compare(version, ">=4.9.0"): + GnuCCompiler.std_warn_args= GnuCCompiler.new_warn + else: + GnuCCompiler.std_warn_args = GnuCCompiler.old_warn def get_always_args(self): return ['-pipe'] @@ -1119,7 +1125,9 @@ class ClangCCompiler(CCompiler): class GnuCPPCompiler(CPPCompiler): - std_warn_args = ['-Wall', '-Wpedantic', '-Winvalid-pch', '-Wnon-virtual-dtor'] + std_warn_args = [] + new_warn = ['-Wall', '-Wpedantic', '-Winvalid-pch', '-Wnon-virtual-dtor'] + old_warn = ['-Wall', '-pedantic', '-Winvalid-pch', '-Wnon-virtual-dtor'] # may need to separate the latter to extra_debug_args or something std_debug_args = ['-g'] @@ -1127,6 +1135,10 @@ class GnuCPPCompiler(CPPCompiler): CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrap) self.id = 'gcc' self.gcc_type = gcc_type + if mesonlib.version_compare(version, ">=4.9.0"): + GnuCPPCompiler.std_warn_args= GnuCPPCompiler.new_warn + else: + GnuCPPCompiler.std_warn_args = GnuCPPCompiler.old_warn def get_always_args(self): return ['-pipe'] |