Commit dea1df4e authored by Stephen Kelly's avatar Stephen Kelly Committed by Brad King
Browse files

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.
parent 26dba6a1
......@@ -142,7 +142,7 @@ public:
std::vector<IncludeDirectoriesEntry*> IncludeDirectoriesEntries;
std::vector<cmValueWithOrigin> LinkInterfaceIncludeDirectoriesEntries;
std::vector<IncludeDirectoriesEntry*>
std::map<std::string, std::vector<IncludeDirectoriesEntry*> >
CachedLinkInterfaceIncludeDirectoriesEntries;
std::map<std::string, std::string> CachedLinkInterfaceCompileDefinitions;
......@@ -164,6 +164,19 @@ void deleteAndClear(
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()
{
......@@ -2976,14 +2989,15 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(
includeGenex);
this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries.push_back(
this->Internal
->CachedLinkInterfaceIncludeDirectoriesEntries[configString].push_back(
new cmTargetInternals::IncludeDirectoriesEntry(cge,
it->Value));
}
}
processIncludeDirectories(this,
this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries,
this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries[configString],
includes,
uniqueIncludes,
&dagChecker,
......@@ -2993,7 +3007,7 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
if (!this->Makefile->IsGeneratingBuildSystem())
{
deleteAndClear(
this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries);
this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries);
}
else
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment