diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2018-10-01 21:57:39 +0100 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2018-11-04 15:42:06 +0000 |
commit | b5b7e5b94ae7aaacc04a9d15e60892c385e9388e (patch) | |
tree | c5468ee77267c5a5683c7892b5127be580ffe043 | |
parent | bb31a8c1c752cff6f969e345f3a170f935f159cf (diff) | |
download | meson-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.
-rw-r--r-- | mesonbuild/compilers/c.py | 2 |
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 |