cmSystemTools: Implement GetRealPath on Windows

Use `cm::PathResolver`'s `RealPath` variant to normalize paths,
look up their on-disk case, and resolve symlinks, but without
resolving `subst` drives on Windows.

Fixes: #17206
This commit is contained in:
Brad King
2024-11-04 11:47:51 -05:00
parent 384dbef61e
commit 823e1df54c
3 changed files with 27 additions and 5 deletions
+1 -3
View File
@@ -1409,8 +1409,7 @@ bool HandleRealPathCommand(std::vector<std::string> const& args,
auto basePath = cmCMakePath{ *arguments.BaseDirectory };
path = basePath.Append(path);
}
result = cmSystemTools::GetActualCaseForPath(
cmSystemTools::GetRealPath(path.String()));
result = cmSystemTools::GetRealPath(path.String());
};
std::string realPath;
@@ -1420,7 +1419,6 @@ bool HandleRealPathCommand(std::vector<std::string> const& args,
std::string oldPolicyPath =
cmSystemTools::CollapseFullPath(input, *arguments.BaseDirectory);
oldPolicyPath = cmSystemTools::GetRealPath(oldPolicyPath);
oldPolicyPath = cmSystemTools::GetActualCaseForPath(oldPolicyPath);
if (warnAbout152) {
computeNewPath(input, realPath);
if (oldPolicyPath != realPath) {