From ee34f454caddd93ce94baf60e6cb4098fc785b09 Mon Sep 17 00:00:00 2001 From: Peter Harris Date: Tue, 15 Aug 2017 18:05:11 -0400 Subject: 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 --- mesonbuild/compilers/compilers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mesonbuild/compilers') 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): -- cgit v1.1