cmGeneratorTarget: Cache GetAllConfigCompileLanguages

This commit is contained in:
John Franklin Rickard
2026-02-06 12:27:13 -05:00
committed by Brad King
parent 6ed75b1fe6
commit 62a4099fd2
3 changed files with 14 additions and 2 deletions
+1
View File
@@ -533,6 +533,7 @@ cmValue cmGeneratorTarget::GetFileSuffixInternal(
void cmGeneratorTarget::ClearSourcesCache()
{
this->AllConfigSources.clear();
this->AllConfigCompileLanguages.clear();
this->KindedSourcesMap.clear();
this->SourcesAreContextDependent = Tribool::Indeterminate;
this->Objects.clear();
+3
View File
@@ -1326,6 +1326,9 @@ private:
mutable std::vector<AllConfigSource> AllConfigSources;
void ComputeAllConfigSources() const;
mutable std::set<std::string> AllConfigCompileLanguages;
void ComputeAllConfigCompileLanguages() const;
mutable std::unordered_map<std::string, bool> MaybeInterfacePropertyExists;
bool MaybeHaveInterfaceProperty(std::string const& prop,
cm::GenEx::Evaluation* eval,
+10 -2
View File
@@ -511,7 +511,7 @@ cmGeneratorTarget::GetAllConfigSources(SourceKind kind) const
return result;
}
std::set<std::string> cmGeneratorTarget::GetAllConfigCompileLanguages() const
void cmGeneratorTarget::ComputeAllConfigCompileLanguages() const
{
std::set<std::string> languages;
std::vector<AllConfigSource> const& sources = this->GetAllConfigSources();
@@ -521,5 +521,13 @@ std::set<std::string> cmGeneratorTarget::GetAllConfigCompileLanguages() const
languages.emplace(lang);
}
}
return languages;
this->AllConfigCompileLanguages = languages;
}
std::set<std::string> cmGeneratorTarget::GetAllConfigCompileLanguages() const
{
if (this->AllConfigCompileLanguages.empty()) {
this->ComputeAllConfigCompileLanguages();
}
return this->AllConfigCompileLanguages;
}