mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-02 20:29:49 -05:00
Autogen: Clear sources meta data cache
Adds cmGeneratorTarget::clearSourcesCache() which clears the cache of precomputed sources lists and object names. The cache gets recomputed on demand. Clearing the cache is necessary in case an OBJECT library gets a source added after a target (ORIGIN) that includes it computed it's external sources cache. This may happen in AUTOMOC when ORIGIN is processed before the OBJECT library which gets a mocs_compilation.cpp file added. Closes #17152 Closes #17139 Closes #17085 Closes #15967
This commit is contained in:
@@ -326,6 +326,13 @@ std::string cmGeneratorTarget::GetOutputName(
|
||||
return i->second;
|
||||
}
|
||||
|
||||
void cmGeneratorTarget::ClearSourcesCache()
|
||||
{
|
||||
this->KindedSourcesMap.clear();
|
||||
this->LinkImplementationLanguageIsContextDependent = true;
|
||||
this->Objects.clear();
|
||||
}
|
||||
|
||||
void cmGeneratorTarget::AddSourceCommon(const std::string& src)
|
||||
{
|
||||
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
|
||||
@@ -333,8 +340,7 @@ void cmGeneratorTarget::AddSourceCommon(const std::string& src)
|
||||
CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(src);
|
||||
cge->SetEvaluateForBuildsystem(true);
|
||||
this->SourceEntries.push_back(new TargetPropertyEntry(cge));
|
||||
this->KindedSourcesMap.clear();
|
||||
this->LinkImplementationLanguageIsContextDependent = true;
|
||||
this->ClearSourcesCache();
|
||||
}
|
||||
|
||||
void cmGeneratorTarget::AddSource(const std::string& src)
|
||||
|
||||
Reference in New Issue
Block a user