summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-02-28 14:39:16 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2017-02-28 14:39:16 (GMT)
commit322472e571f75f803c148a8ebba25c6d0247fc82 (patch)
tree1d2fd3bf4026a6ada0f23d30ef75cc20b159e406 /Source
parent0aec4d38642570cc38440b5368fec4de02e09a6a (diff)
parent73a6d4566a9fa13ffaef2f1111be808a220ba867 (diff)
downloadCMake-322472e571f75f803c148a8ebba25c6d0247fc82.zip
CMake-322472e571f75f803c148a8ebba25c6d0247fc82.tar.gz
CMake-322472e571f75f803c148a8ebba25c6d0247fc82.tar.bz2
Merge topic 'cache-xaml-resx-headers'
73a6d456 VS: Cache the list of xaml and resx headers
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGeneratorTarget.cxx26
-rw-r--r--Source/cmGeneratorTarget.h4
2 files changed, 23 insertions, 7 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 5815210..47d685d 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -711,12 +711,18 @@ void cmGeneratorTarget::GetExternalObjects(
IMPLEMENT_VISIT(ExternalObjects);
}
-void cmGeneratorTarget::GetExpectedResxHeaders(std::set<std::string>& srcs,
+void cmGeneratorTarget::GetExpectedResxHeaders(std::set<std::string>& headers,
const std::string& config) const
{
- ResxData data;
- IMPLEMENT_VISIT_IMPL(Resx, COMMA cmGeneratorTarget::ResxData)
- srcs = data.ExpectedResxHeaders;
+ HeadersCacheType::const_iterator it = this->ResxHeadersCache.find(config);
+ if (it == this->ResxHeadersCache.end()) {
+ ResxData data;
+ IMPLEMENT_VISIT_IMPL(Resx, COMMA cmGeneratorTarget::ResxData)
+ it = this->ResxHeadersCache
+ .insert(std::make_pair(config, data.ExpectedResxHeaders))
+ .first;
+ }
+ headers = it->second;
}
void cmGeneratorTarget::GetResxSources(std::vector<cmSourceFile const*>& srcs,
@@ -748,9 +754,15 @@ void cmGeneratorTarget::GetCertificates(std::vector<cmSourceFile const*>& data,
void cmGeneratorTarget::GetExpectedXamlHeaders(std::set<std::string>& headers,
const std::string& config) const
{
- XamlData data;
- IMPLEMENT_VISIT_IMPL(Xaml, COMMA cmGeneratorTarget::XamlData)
- headers = data.ExpectedXamlHeaders;
+ HeadersCacheType::const_iterator it = this->XamlHeadersCache.find(config);
+ if (it == this->XamlHeadersCache.end()) {
+ XamlData data;
+ IMPLEMENT_VISIT_IMPL(Xaml, COMMA cmGeneratorTarget::XamlData)
+ it = this->XamlHeadersCache
+ .insert(std::make_pair(config, data.ExpectedXamlHeaders))
+ .first;
+ }
+ headers = it->second;
}
void cmGeneratorTarget::GetExpectedXamlSources(std::set<std::string>& srcs,
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 689fbda..e72e0a6 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -739,6 +739,10 @@ private:
bool ComputePDBOutputDir(const std::string& kind, const std::string& config,
std::string& out) const;
+ typedef std::map<std::string, std::set<std::string> > HeadersCacheType;
+ mutable HeadersCacheType ResxHeadersCache;
+ mutable HeadersCacheType XamlHeadersCache;
+
public:
const std::vector<const cmGeneratorTarget*>& GetLinkImplementationClosure(
const std::string& config) const;