diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-04-05 09:40:38 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-04-06 08:02:34 (GMT) |
commit | c5b26f3bec0e6e18255802da53886eae30a74021 (patch) | |
tree | e2aab9c6a9bd1923d09f96b991bf4f31de25d127 /Source/cmGeneratorTarget.cxx | |
parent | eb163f37d449af27fe8446c5d8d632aa295b6428 (diff) | |
download | CMake-c5b26f3bec0e6e18255802da53886eae30a74021.zip CMake-c5b26f3bec0e6e18255802da53886eae30a74021.tar.gz CMake-c5b26f3bec0e6e18255802da53886eae30a74021.tar.bz2 |
cmTarget: Cache the cmSourceFiles in GetSourceFiles.
Avoid calling GetSourceFiles with the same result container multiple
times when tracing target dependencies. The result from the previous
configuration is cached and used later otherwise.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 01fad26..69a2977 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -636,26 +636,26 @@ cmTargetTraceDependencies // Queue all the source files already specified for the target. if (this->Target->GetType() != cmTarget::INTERFACE_LIBRARY) { - std::vector<std::string> sources; std::vector<std::string> configs; this->Makefile->GetConfigurations(configs); if (configs.empty()) { configs.push_back(""); } + std::set<std::string> emitted; for(std::vector<std::string>::const_iterator ci = configs.begin(); ci != configs.end(); ++ci) { + std::vector<std::string> sources; this->Target->GetSourceFiles(sources, *ci); - } - std::set<std::string> emitted; - for(std::vector<std::string>::const_iterator si = sources.begin(); - si != sources.end(); ++si) - { - if(emitted.insert(*si).second && this->SourcesQueued.insert(*si).second) + for(std::vector<std::string>::const_iterator si = sources.begin(); + si != sources.end(); ++si) { - this->SourceQueue.push(*si); - this->Makefile->GetOrCreateSource(*si); + if(emitted.insert(*si).second && this->SourcesQueued.insert(*si).second) + { + this->SourceQueue.push(*si); + this->Makefile->GetOrCreateSource(*si); + } } } } |