summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2024-07-14 23:33:05 +0100
committerEli Schwartz <eschwartz93@gmail.com>2024-07-19 01:36:41 -0400
commit7a306e1a46a91dadb77656a6998a8dcaa6482b8f (patch)
treeeaed74716dc509a9e1c3d73808175fd1160282db /mesonbuild/compilers
parent2548f921a29babe665593e5dcf401eb27aedd174 (diff)
downloadmeson-7a306e1a46a91dadb77656a6998a8dcaa6482b8f.tar.gz
compilers: handle -Wno-attributes= for GCC
For other reasons, Meson transforms "-Wno-x" into "-Wx -Wno-x" for GCC, but this breaks with "-Wno-attributes=x" with: ``` cc1plus: error: arguments ignored for '-Wattributes='; use '-Wno-attributes=' instead ``` Suppress that workaround for -Wno-attributes=. Closes: https://github.com/mesonbuild/meson/issues/13022
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r--mesonbuild/compilers/mixins/clike.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py
index 1fddb0f95..9f5fc5052 100644
--- a/mesonbuild/compilers/mixins/clike.py
+++ b/mesonbuild/compilers/mixins/clike.py
@@ -1268,8 +1268,10 @@ class CLikeCompiler(Compiler):
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-'):
+ # check the equivalent enable flag too "-Wforgotten-towel".
+ # Make an exception for -Wno-attributes=x as -Wattributes=x is invalid
+ # for GCC at least.
+ if arg.startswith('-Wno-') and not arg.startswith('-Wno-attributes='):
new_args.append('-W' + arg[5:])
if arg.startswith('-Wl,'):
mlog.warning(f'{arg} looks like a linker argument, '