diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-09-25 07:53:49 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-09-25 07:53:49 +0530 |
commit | e459fd2f53dfe13297630cc04e4a420f12668f8a (patch) | |
tree | 0f726c838a1d84cfc784aa9ae51741a37f1bdaf8 | |
parent | f1b6c89d9ca54831b753c7a4fa76d3e0980f8fd3 (diff) | |
download | meson-e459fd2f53dfe13297630cc04e4a420f12668f8a.zip meson-e459fd2f53dfe13297630cc04e4a420f12668f8a.tar.gz meson-e459fd2f53dfe13297630cc04e4a420f12668f8a.tar.bz2 |
compilers: Fall back to -pedantic with older GCC
Fixes https://github.com/mesonbuild/meson/issues/242
-rw-r--r-- | mesonbuild/compilers.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index 4ee94d6..aafaa7f 100644 --- a/mesonbuild/compilers.py +++ b/mesonbuild/compilers.py @@ -1971,6 +1971,14 @@ class GnuCompiler: return gnu_color_args[colortype][:] return [] + def get_warn_args(self, level): + args = super().get_warn_args(level) + if mesonlib.version_compare(self.version, '<4.8.0') and '-Wpedantic' in args: + # -Wpedantic was added in 4.8.0 + # https://gcc.gnu.org/gcc-4.8/changes.html + args[args.index('-Wpedantic')] = '-pedantic' + return args + def get_pic_args(self): if self.gcc_type == GCC_MINGW: return [] # On Window gcc defaults to fpic being always on. |