diff options
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 54c3737..30305a1 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -554,6 +554,15 @@ cmGlobalNinjaGenerator::cmGlobalNinjaGenerator(cmake* cm) { #ifdef _WIN32 cm->GetState()->SetWindowsShell(true); + + // Attempt to use full path to COMSPEC, default "cmd.exe" + std::string comspec; + if (cmSystemTools::GetEnv("COMSPEC", comspec) && + cmSystemTools::FileIsFullPath(comspec)) { + this->Comspec = comspec; + } else { + this->Comspec = "cmd.exe"; + } #endif this->FindMakeProgramFile = "CMakeNinjaFindMake.cmake"; } |