diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-08-15 00:02:06 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-08-15 01:38:01 +0530 |
commit | 7d367763079c9a5a67017f6a5b9e31a218841019 (patch) | |
tree | cdcb999ec38b6bac509a6882f74aef76c5a1ee49 /mesonbuild/backend/ninjabackend.py | |
parent | be4428005dff8b17af5696c8f05567de9af1a8c5 (diff) | |
download | meson-7d367763079c9a5a67017f6a5b9e31a218841019.zip meson-7d367763079c9a5a67017f6a5b9e31a218841019.tar.gz meson-7d367763079c9a5a67017f6a5b9e31a218841019.tar.bz2 |
ninja: Fix detection of vs compiler usage
Just because cl.exe exists in PATH doesn't mean we are using it right
now. Instead, check the list of compilers that were configured.
Diffstat (limited to 'mesonbuild/backend/ninjabackend.py')
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index e898a84..0587cff 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -154,10 +154,12 @@ class NinjaBackend(backends.Backend): def detect_vs_dep_prefix(self, tempfilename): '''VS writes its dependency in a locale dependent format. Detect the search prefix to use.''' - # Of course there is another program called 'cl' on - # some platforms. Let's just require that on Windows - # cl points to msvc. - if not mesonlib.is_windows() or shutil.which('cl') is None: + for compiler in self.build.compilers.values(): + # Have to detect the dependency format + if compiler.id == 'msvc': + break + else: + # None of our compilers are MSVC, we're done. return open(tempfilename, 'a') filename = os.path.join(self.environment.get_scratch_dir(), 'incdetect.c') |