cmLocalGenerator: Simplify CPATH lookup loop

This commit is contained in:
Alexander Grund 2021-07-06 16:11:42 +02:00 committed by Brad King
parent 86595b3002
commit 5c02964aff

View File

@ -107,10 +107,9 @@ cmLocalGenerator::cmLocalGenerator(cmGlobalGenerator* gg, cmMakefile* makefile)
{
std::vector<std::string> cpath;
cmSystemTools::GetPath(cpath, "CPATH");
for (std::string& cp : cpath) {
for (std::string const& cp : cpath) {
if (cmSystemTools::FileIsFullPath(cp)) {
cp = cmSystemTools::CollapseFullPath(cp);
this->EnvCPATH.emplace(std::move(cp));
this->EnvCPATH.emplace(cmSystemTools::CollapseFullPath(cp));
}
}
}