diff options
| author | Brad King <brad.king@kitware.com> | 2023-04-27 13:07:07 (GMT) |
|---|---|---|
| committer | Kitware Robot <kwrobot@kitware.com> | 2023-04-27 13:07:18 (GMT) |
| commit | 5f40448da5cc15e55822b28c610cf76f87f7c831 (patch) | |
| tree | 7c819f26d19e901b076bc637ae6e1cc8ae98d2fc | |
| parent | c8c6e9ac1bfdcafbb841b280fffa757922db66cc (diff) | |
| parent | a368a5946744191b3385774882b08a2f0cf7bd48 (diff) | |
| download | CMake-5f40448da5cc15e55822b28c610cf76f87f7c831.zip CMake-5f40448da5cc15e55822b28c610cf76f87f7c831.tar.gz CMake-5f40448da5cc15e55822b28c610cf76f87f7c831.tar.bz2 | |
Merge topic 'fix-short-path'
a368a59467 Windows: Tolerate GetShortPathNameW failure
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8432
| -rw-r--r-- | Source/cmOutputConverter.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx index 40fed80..53cb21e 100644 --- a/Source/cmOutputConverter.cxx +++ b/Source/cmOutputConverter.cxx @@ -175,7 +175,12 @@ std::string cmOutputConverter::ConvertToOutputForExisting( } std::string tmp{}; - cmSystemTools::GetShortPath(remote, tmp); + cmsys::Status status = cmSystemTools::GetShortPath(remote, tmp); + if (!status) { + // Fallback for cases when Windows refuses to resolve the short path, + // like for C:\Program Files\WindowsApps\... + tmp = remote; + } shortPathCache[remote] = tmp; return tmp; }(); |
