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.
pull/2191/head
Nirbheek Chauhan 8 years ago
parent be4428005d
commit 7d36776307
  1. 10
      mesonbuild/backend/ninjabackend.py

@ -154,10 +154,12 @@ class NinjaBackend(backends.Backend):
def detect_vs_dep_prefix(self, tempfilename): def detect_vs_dep_prefix(self, tempfilename):
'''VS writes its dependency in a locale dependent format. '''VS writes its dependency in a locale dependent format.
Detect the search prefix to use.''' Detect the search prefix to use.'''
# Of course there is another program called 'cl' on for compiler in self.build.compilers.values():
# some platforms. Let's just require that on Windows # Have to detect the dependency format
# cl points to msvc. if compiler.id == 'msvc':
if not mesonlib.is_windows() or shutil.which('cl') is None: break
else:
# None of our compilers are MSVC, we're done.
return open(tempfilename, 'a') return open(tempfilename, 'a')
filename = os.path.join(self.environment.get_scratch_dir(), filename = os.path.join(self.environment.get_scratch_dir(),
'incdetect.c') 'incdetect.c')

Loading…
Cancel
Save