aboutsummaryrefslogtreecommitdiff
path: root/test cases/common/112 has arg
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 /test cases/common/112 has arg
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 'test cases/common/112 has arg')
-rw-r--r--test cases/common/112 has arg/meson.build7
1 files changed, 7 insertions, 0 deletions
diff --git a/test cases/common/112 has arg/meson.build b/test cases/common/112 has arg/meson.build
index 15d8cc8..a89b59e 100644
--- a/test cases/common/112 has arg/meson.build
+++ b/test cases/common/112 has arg/meson.build
@@ -42,3 +42,10 @@ if cc.get_id() == 'gcc'
assert(cc.has_multi_arguments(pre_arg), 'Arg that should have worked does not work.')
assert(cc.has_multi_arguments([pre_arg, arg]), 'Arg that should have worked does not work.')
endif
+
+if cc.get_id() == 'clang' and cc.version().version_compare('<=4.0.0')
+ # 4.0.0 does not support -fpeel-loops. Newer versions may.
+ # Please adjust above version number as new versions of clang are released.
+ notyet_arg = '-fpeel-loops'
+ assert(not cc.has_argument(notyet_arg), 'Arg that should be broken (unless clang added support recently) is not.')
+endif