diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2018-09-20 20:29:57 +0100 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2018-11-04 15:42:00 +0000 |
commit | 64edfd50691be21fae1e61b8864d6de6fcead1d4 (patch) | |
tree | edff913b3cc3fa1adf558e1b1c860aad8f7a7717 /mesonbuild/backend/backends.py | |
parent | 63f4f9481ebc865b11a06aeecf0c624104d46afd (diff) | |
download | meson-64edfd50691be21fae1e61b8864d6de6fcead1d4.zip meson-64edfd50691be21fae1e61b8864d6de6fcead1d4.tar.gz meson-64edfd50691be21fae1e61b8864d6de6fcead1d4.tar.bz2 |
Detect clang-cl as msvc-like, not clang-like
Handle clang's cl or clang-cl being in PATH, or set in CC/CXX
Future work: checking the name of the executable here seems like a bad idea.
These compilers will fail to be detected if they are renamed.
v2:
Update compiler.get_argument_type() test
Fix comparisons of id inside CCompiler, backends and elsewhere
v3:
ClangClCPPCompiler should be a subclass of ClangClCCompier, as well
Future work: mocking in test_find_library_patterns() is effected, as we
now test for a subclass, rather than self.id in CCompiler.get_library_naming()
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r-- | mesonbuild/backend/backends.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 7dc1b83..370e35b 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -23,7 +23,7 @@ import subprocess from ..mesonlib import MesonException, OrderedSet from ..mesonlib import classify_unity_sources from ..mesonlib import File -from ..compilers import CompilerArgs +from ..compilers import CompilerArgs, VisualStudioCCompiler from collections import OrderedDict import shlex from functools import lru_cache @@ -491,7 +491,7 @@ class Backend: return args extra_args = [] # Compiler-specific escaping is needed for -D args but not for any others - if compiler.get_id() == 'msvc': + if isinstance(compiler, VisualStudioCCompiler): # MSVC needs escaping when a -D argument ends in \ or \" for arg in args: if arg.startswith('-D') or arg.startswith('/D'): |