summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorDmitry Kochkin <dmitry.kochkin@here.com>2017-02-25 21:56:13 (GMT)
committerBrad King <brad.king@kitware.com>2017-02-27 14:22:08 (GMT)
commit73a6d4566a9fa13ffaef2f1111be808a220ba867 (patch)
treea000d963b09b7b30c82fd46d087ef2ae1cb47c32 /Source/cmGeneratorTarget.cxx
parentcdb6d7df970fcaaf6cda1bef9955351222e1bcde (diff)
downloadCMake-73a6d4566a9fa13ffaef2f1111be808a220ba867.zip
CMake-73a6d4566a9fa13ffaef2f1111be808a220ba867.tar.gz
CMake-73a6d4566a9fa13ffaef2f1111be808a220ba867.tar.bz2
VS: Cache the list of xaml and resx headers
Speed up VS project generation with many such headers.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx26
1 files changed, 19 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,