diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-09-13 07:57:43 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-10-07 06:37:58 (GMT) |
commit | 7b6dc0fe45c7064ad741461bfaf19028e8539c78 (patch) | |
tree | 048e3eae0cb243af3ea5f6e5970d42e4064201d6 /Source/cmGeneratorTarget.cxx | |
parent | 33f87bb1f503c09a6b8018edf97b615f0e7f713d (diff) | |
download | CMake-7b6dc0fe45c7064ad741461bfaf19028e8539c78.zip CMake-7b6dc0fe45c7064ad741461bfaf19028e8539c78.tar.gz CMake-7b6dc0fe45c7064ad741461bfaf19028e8539c78.tar.bz2 |
cmGeneratorTarget: Inline GetSourceFiles from cmTarget.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 357b972..43ce882 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -842,7 +842,40 @@ static void AddInterfaceEntries( void cmGeneratorTarget::GetSourceFiles(std::vector<cmSourceFile*> &files, const std::string& config) const { - this->Target->GetSourceFiles(files, config); + // Lookup any existing link implementation for this configuration. + std::string key = cmSystemTools::UpperCase(config); + + cmTarget::SourceFilesMapType& sfm = this->Target->GetSourceFilesMap(); + if(!this->Target->GetLinkImplementationLanguageIsContextDependent()) + { + files = sfm.begin()->second; + return; + } + + cmTarget::SourceFilesMapType::iterator + it = sfm.find(key); + if(it != sfm.end()) + { + files = it->second; + } + else + { + std::vector<std::string> srcs; + this->Target->GetSourceFiles(srcs, config); + + std::set<cmSourceFile*> emitted; + + for(std::vector<std::string>::const_iterator i = srcs.begin(); + i != srcs.end(); ++i) + { + cmSourceFile* sf = this->Makefile->GetOrCreateSource(*i); + if (emitted.insert(sf).second) + { + files.push_back(sf); + } + } + sfm[key] = files; + } } //---------------------------------------------------------------------------- |