mirror of
https://github.com/Kitware/CMake.git
synced 2026-07-14 03:20:40 +00:00
Windows: Restore support for running CMake through a symlink
The change in commit v3.11.3~3^2 (cmSystemTools: Revert GetRealPath implementation on Windows, 2018-05-29) broke the feature added by commit v3.11.0-rc1~64^2 (Windows: Add support for running CMake tools through a symlink, 2018-01-21). Use `GetRealPathResolvingWindowsSubst` in the latter code path to restore it. Fixes: #17882
This commit is contained in:
@@ -2117,7 +2117,8 @@ void cmSystemTools::FindCMakeResources(const char* argv0)
|
||||
wchar_t modulepath[_MAX_PATH];
|
||||
::GetModuleFileNameW(NULL, modulepath, sizeof(modulepath));
|
||||
std::string path = cmsys::Encoding::ToNarrow(modulepath);
|
||||
std::string realPath = cmSystemTools::GetRealPath(path, NULL);
|
||||
std::string realPath =
|
||||
cmSystemTools::GetRealPathResolvingWindowsSubst(path, NULL);
|
||||
if (realPath.empty()) {
|
||||
realPath = path;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user