compilers: Fall back to -pedantic with older GCC

Fixes https://github.com/mesonbuild/meson/issues/242
pull/812/head
Nirbheek Chauhan 8 years ago
parent f1b6c89d9c
commit e459fd2f53
  1. 8
      mesonbuild/compilers.py

@ -1971,6 +1971,14 @@ class GnuCompiler:
return gnu_color_args[colortype][:] return gnu_color_args[colortype][:]
return [] 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): def get_pic_args(self):
if self.gcc_type == GCC_MINGW: if self.gcc_type == GCC_MINGW:
return [] # On Window gcc defaults to fpic being always on. return [] # On Window gcc defaults to fpic being always on.

Loading…
Cancel
Save