aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-09-25 18:52:05 +0300
committerGitHub <noreply@github.com>2016-09-25 18:52:05 +0300
commit84d4dc3bbbc59929cb0d2f43b594e2ceff29dacc (patch)
treeba7280b3d31b75cf8cdcf13d5efc9c1de37d794b
parent8784c35dde047d68e18d4f41160b1923c8ed754b (diff)
parente8dc13248eda9dda04cffdc68609e55989328ea3 (diff)
downloadmeson-84d4dc3bbbc59929cb0d2f43b594e2ceff29dacc.zip
meson-84d4dc3bbbc59929cb0d2f43b594e2ceff29dacc.tar.gz
meson-84d4dc3bbbc59929cb0d2f43b594e2ceff29dacc.tar.bz2
Merge pull request #812 from centricular/older-gcc-pedantic
compilers: Fall back to -pedantic with older GCC
-rw-r--r--mesonbuild/compilers.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index 4ee94d6..8772803 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -1731,7 +1731,7 @@ class VisualStudioCCompiler(CCompiler):
self.always_args = ['/nologo', '/showIncludes']
self.warn_args = {'1': ['/W2'],
'2': ['/W3'],
- '3': ['/w4']}
+ '3': ['/W4']}
self.base_options = ['b_pch'] # FIXME add lto, pgo and the like
def get_always_args(self):
@@ -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.