Ninja: Pre-compute "CMakeCache.txt" build target name

This commit is contained in:
Nicolas Despres 2016-05-13 23:44:25 +02:00 committed by Brad King
parent 3b3ecdfa48
commit 0397c92a15
2 changed files with 4 additions and 2 deletions

View File

@ -489,6 +489,7 @@ void cmGlobalNinjaGenerator::Generate()
this->OpenRulesFileStream();
this->TargetAll = "all";
this->CMakeCacheFile = "CMakeCache.txt";
this->PolicyCMP0058 =
this->LocalGenerators[0]->GetMakefile()->GetPolicyStatus(
@ -1040,7 +1041,7 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
}
}
}
knownDependencies.insert("CMakeCache.txt");
knownDependencies.insert(this->CMakeCacheFile);
for (TargetAliasMap::const_iterator i = this->TargetAliases.begin();
i != this->TargetAliases.end(); ++i) {
@ -1168,7 +1169,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
implicitDeps.push_back(this->ConvertToNinjaPath(*fi));
}
}
implicitDeps.push_back("CMakeCache.txt");
implicitDeps.push_back(this->CMakeCacheFile);
std::sort(implicitDeps.begin(), implicitDeps.end());
implicitDeps.erase(std::unique(implicitDeps.begin(), implicitDeps.end()),

View File

@ -400,6 +400,7 @@ private:
private:
std::string TargetAll;
std::string CMakeCacheFile;
};
#endif // ! cmGlobalNinjaGenerator_h