diff options
author | Brad King <brad.king@kitware.com> | 2024-08-22 13:02:53 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-08-22 13:03:05 (GMT) |
commit | 3d61720112c827fc8cfa3d72ed1e76c7ed203186 (patch) | |
tree | 971a12cb325614f4820d400038d056fbf5af4c4e /Source/cmSystemTools.cxx | |
parent | 497b43b997c653855c1c37eb8bce16ac49982527 (diff) | |
parent | 8d1803d463adac8ebc63bb0d1a9ef55b6c56472a (diff) | |
download | CMake-3d61720112c827fc8cfa3d72ed1e76c7ed203186.zip CMake-3d61720112c827fc8cfa3d72ed1e76c7ed203186.tar.gz CMake-3d61720112c827fc8cfa3d72ed1e76c7ed203186.tar.bz2 |
Merge topic 'autogen-predefs-emscripten'
8d1803d463 AutoGen: Run batch scripts using cmd.exe on windows platforms explicitly
9ab270f47d cmSystemTools: Add GetComspec method to get cmd on Windows
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9733
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 136dc93..0a6b683 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -970,6 +970,17 @@ cmSystemTools::WindowsVersion cmSystemTools::GetWindowsVersion() result.dwBuildNumber = osviex.dwBuildNumber; return result; } + +std::string cmSystemTools::GetComspec() +{ + std::string comspec; + if (!cmSystemTools::GetEnv("COMSPEC", comspec) || + !cmSystemTools::FileIsFullPath(comspec)) { + comspec = "cmd.exe"; + } + return comspec; +} + #endif std::string cmSystemTools::GetRealPathResolvingWindowsSubst( |