aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/c.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2018-04-11 17:07:57 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2018-04-17 09:55:18 +0000
commit695b8f3a0377d3e2ce78ba8716adc365b18edea1 (patch)
treed301a0871874f1ae913c6c50fe006d2404a773bf /mesonbuild/compilers/c.py
parent162a58b493eb30ccca8179febc4cfbf3fdaf7cb5 (diff)
downloadmeson-695b8f3a0377d3e2ce78ba8716adc365b18edea1.zip
meson-695b8f3a0377d3e2ce78ba8716adc365b18edea1.tar.gz
meson-695b8f3a0377d3e2ce78ba8716adc365b18edea1.tar.bz2
cc.has_multi_arguments: Convert all -Wno args
Also add a test for it.
Diffstat (limited to 'mesonbuild/compilers/c.py')
-rw-r--r--mesonbuild/compilers/c.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index 7f45ecb..a6bd0af 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -840,18 +840,18 @@ class CCompiler(Compiler):
return ['-pthread']
def has_multi_arguments(self, args, env):
- for arg in args:
+ for arg in args[:]:
+ # some compilers, e.g. GCC, don't warn for unsupported warning-disable
+ # flags, so when we are testing a flag like "-Wno-forgotten-towel", also
+ # check the equivalent enable flag too "-Wforgotten-towel"
+ if arg.startswith('-Wno-'):
+ args.append('-W' + arg[5:])
if arg.startswith('-Wl,'):
mlog.warning('''{} looks like a linker argument, but has_argument
and other similar methods only support checking compiler arguments.
Using them to check linker arguments are never supported, and results
are likely to be wrong regardless of the compiler you are using.
'''.format(arg))
- # some compilers, e.g. GCC, don't warn for unsupported warning-disable
- # flags, so when we are testing a flag like "-Wno-forgotten-towel", also
- # check the equivalent enable flag too "-Wforgotten-towel"
- if len(args) == 1 and args[0].startswith('-Wno-'):
- args.append('-W' + args[0][5:])
return self.compiles('int i;\n', env, extra_args=args)