diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2024-08-19 19:10:18 (GMT) |
---|---|---|
committer | Alexey Edelev <alexey.edelev@qt.io> | 2024-08-21 09:05:16 (GMT) |
commit | 9ab270f47d68198dee29780a346294a728087105 (patch) | |
tree | 788a890f4c1bc06ea38d032f57e26bbfbe8bd7b8 /Source/cmGlobalNinjaGenerator.cxx | |
parent | b2b3c5825fae1c650086932149b81959573e867c (diff) | |
download | CMake-9ab270f47d68198dee29780a346294a728087105.zip CMake-9ab270f47d68198dee29780a346294a728087105.tar.gz CMake-9ab270f47d68198dee29780a346294a728087105.tar.bz2 |
cmSystemTools: Add GetComspec method to get cmd on Windows
The function attempts to read the path to cmd executable from the
COMSPEC environment variable. Falls back to cmd.exe if the respective
environment variable is not set or path doesn't exist.
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 7d62fa8..b051d67 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -573,13 +573,7 @@ cmGlobalNinjaGenerator::cmGlobalNinjaGenerator(cmake* cm) 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"; - } + this->Comspec = cmSystemTools::GetComspec(); #endif cm->GetState()->SetNinja(true); this->FindMakeProgramFile = "CMakeNinjaFindMake.cmake"; |