diff options
author | Peter Harris <peter@harr.ca> | 2017-08-15 18:05:11 -0400 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-08-18 12:11:20 +0300 |
commit | ee34f454caddd93ce94baf60e6cb4098fc785b09 (patch) | |
tree | e1d6beeb43c8656448753e34ec9bfddf1bbc6c44 /mesonbuild/compilers/compilers.py | |
parent | 9607abbe0dcc4eb99408ad0229d799346afdc3b1 (diff) | |
download | meson-ee34f454caddd93ce94baf60e6cb4098fc785b09.zip meson-ee34f454caddd93ce94baf60e6cb4098fc785b09.tar.gz meson-ee34f454caddd93ce94baf60e6cb4098fc785b09.tar.bz2 |
Fix detection of clang "optimization arguments"
In version 3.6.0, clang added -Wignored-optimization-argument. Without
setting this flag to -Werror, "ignored optimization arguments" such as
(for example) -fpeel-loops, are accepted but warned about, leading to
noisy builds if meson thinks the flag is supported.
See also #755
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
-rw-r--r-- | mesonbuild/compilers/compilers.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 3c993ac..5077a6e 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -1041,8 +1041,11 @@ class ClangCompiler: return get_gcc_soname_args(gcc_type, prefix, shlib_name, suffix, path, soversion, is_shared_module) def has_multi_arguments(self, args, env): + myargs = ['-Werror=unknown-warning-option', '-Werror=unused-command-line-argument'] + if mesonlib.version_compare(self.version, '>=3.6.0'): + myargs.append('-Werror=ignored-optimization-argument') return super().has_multi_arguments( - ['-Werror=unknown-warning-option', '-Werror=unused-command-line-argument'] + args, + myargs + args, env) def has_function(self, funcname, prefix, env, extra_args=None, dependencies=None): |