aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/compilers.py
diff options
context:
space:
mode:
authorPeter Harris <peter@harr.ca>2017-08-15 18:05:11 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2017-08-18 12:11:20 +0300
commitee34f454caddd93ce94baf60e6cb4098fc785b09 (patch)
treee1d6beeb43c8656448753e34ec9bfddf1bbc6c44 /mesonbuild/compilers/compilers.py
parent9607abbe0dcc4eb99408ad0229d799346afdc3b1 (diff)
downloadmeson-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.py5
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):