Memoize usage requirement include directories in a config-specific map
Commit 42ebb188
(Memoize includes and defines from interface libraries.,
2013-02-22) introduced caching of the includes. Fix the memoization to
be configuration-specific so that we do not accumulate entries across
multiple evaluations in a multi-config generator.
This commit is contained in:
parent
26dba6a162
commit
dea1df4e5e
|
@ -142,7 +142,7 @@ public:
|
||||||
std::vector<IncludeDirectoriesEntry*> IncludeDirectoriesEntries;
|
std::vector<IncludeDirectoriesEntry*> IncludeDirectoriesEntries;
|
||||||
std::vector<cmValueWithOrigin> LinkInterfaceIncludeDirectoriesEntries;
|
std::vector<cmValueWithOrigin> LinkInterfaceIncludeDirectoriesEntries;
|
||||||
|
|
||||||
std::vector<IncludeDirectoriesEntry*>
|
std::map<std::string, std::vector<IncludeDirectoriesEntry*> >
|
||||||
CachedLinkInterfaceIncludeDirectoriesEntries;
|
CachedLinkInterfaceIncludeDirectoriesEntries;
|
||||||
std::map<std::string, std::string> CachedLinkInterfaceCompileDefinitions;
|
std::map<std::string, std::string> CachedLinkInterfaceCompileDefinitions;
|
||||||
|
|
||||||
|
@ -164,6 +164,19 @@ void deleteAndClear(
|
||||||
entries.clear();
|
entries.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
void deleteAndClear(
|
||||||
|
std::map<std::string,
|
||||||
|
std::vector<cmTargetInternals::IncludeDirectoriesEntry*> > &entries)
|
||||||
|
{
|
||||||
|
for (std::map<std::string,
|
||||||
|
std::vector<cmTargetInternals::IncludeDirectoriesEntry*> >::iterator
|
||||||
|
it = entries.begin(), end = entries.end(); it != end; ++it)
|
||||||
|
{
|
||||||
|
deleteAndClear(it->second);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
cmTargetInternals::~cmTargetInternals()
|
cmTargetInternals::~cmTargetInternals()
|
||||||
{
|
{
|
||||||
|
@ -2976,14 +2989,15 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
|
||||||
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(
|
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(
|
||||||
includeGenex);
|
includeGenex);
|
||||||
|
|
||||||
this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries.push_back(
|
this->Internal
|
||||||
|
->CachedLinkInterfaceIncludeDirectoriesEntries[configString].push_back(
|
||||||
new cmTargetInternals::IncludeDirectoriesEntry(cge,
|
new cmTargetInternals::IncludeDirectoriesEntry(cge,
|
||||||
it->Value));
|
it->Value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
processIncludeDirectories(this,
|
processIncludeDirectories(this,
|
||||||
this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries,
|
this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries[configString],
|
||||||
includes,
|
includes,
|
||||||
uniqueIncludes,
|
uniqueIncludes,
|
||||||
&dagChecker,
|
&dagChecker,
|
||||||
|
@ -2993,7 +3007,7 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
|
||||||
if (!this->Makefile->IsGeneratingBuildSystem())
|
if (!this->Makefile->IsGeneratingBuildSystem())
|
||||||
{
|
{
|
||||||
deleteAndClear(
|
deleteAndClear(
|
||||||
this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries);
|
this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue