cmSystemTools: Add ToNormalizedPathOnDisk helper
`CollapseFullPath` currently accesses the filesystem on Windows to convert the path to the (upper/lower) case it has on disk. Not all call sites need this, so we'd eventually like to remove the behavior. Add a wrapper for call sites to express that they need to match the case of on-disk paths. Issue: #20214
This commit is contained in:
parent
b81c273445
commit
2503b43b6c
@ -1628,6 +1628,13 @@ std::vector<std::string> cmSystemTools::SplitEnvPath(std::string const& value)
|
||||
return paths;
|
||||
}
|
||||
|
||||
std::string cmSystemTools::ToNormalizedPathOnDisk(std::string p)
|
||||
{
|
||||
p = cmSystemTools::CollapseFullPath(p);
|
||||
cmSystemTools::ConvertToUnixSlashes(p);
|
||||
return p;
|
||||
}
|
||||
|
||||
#ifndef CMAKE_BOOTSTRAP
|
||||
bool cmSystemTools::UnsetEnv(const char* value)
|
||||
{
|
||||
|
@ -401,6 +401,8 @@ public:
|
||||
static cm::optional<std::string> GetEnvVar(std::string const& var);
|
||||
static std::vector<std::string> SplitEnvPath(std::string const& value);
|
||||
|
||||
static std::string ToNormalizedPathOnDisk(std::string p);
|
||||
|
||||
#ifndef CMAKE_BOOTSTRAP
|
||||
/** Remove an environment variable */
|
||||
static bool UnsetEnv(const char* value);
|
||||
|
Loading…
Reference in New Issue
Block a user