aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2018-10-01 21:57:39 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2018-11-04 15:42:06 +0000
commitb5b7e5b94ae7aaacc04a9d15e60892c385e9388e (patch)
treec5468ee77267c5a5683c7892b5127be580ffe043 /mesonbuild/compilers
parentbb31a8c1c752cff6f969e345f3a170f935f159cf (diff)
downloadmeson-b5b7e5b94ae7aaacc04a9d15e60892c385e9388e.zip
meson-b5b7e5b94ae7aaacc04a9d15e60892c385e9388e.tar.gz
meson-b5b7e5b94ae7aaacc04a9d15e60892c385e9388e.tar.bz2
Teach VisualStudioCCompiler.has_arguments() about clang-cl
When invoked as clang-cl to compile, it doesn't emit cl-compatible D9002 warnings about unknown options, but fortunately also supports -Werror-unknown-argument instead. When invoked to link, and using LINK, it does emit cl-compatible LNK4044 warnings about unknown options.
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r--mesonbuild/compilers/c.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index b41625c..24f661f 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -1451,6 +1451,8 @@ class VisualStudioCCompiler(CCompiler):
# http://stackoverflow.com/questions/15259720/how-can-i-make-the-microsoft-c-compiler-treat-unknown-flags-as-errors-rather-t
def has_arguments(self, args, env, code, mode):
warning_text = '4044' if mode == 'link' else '9002'
+ if self.id == 'clang-cl' and mode != 'link':
+ args = args + ['-Werror=unknown-argument']
with self._build_wrapper(code, env, extra_args=args, mode=mode) as p:
if p.returncode != 0:
return False