diff options
author | Brad King <brad.king@kitware.com> | 2014-06-30 10:28:08 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-07-07 08:52:36 -0400 |
commit | 82e91e34872fd8fa394d14f1e4fac60f9e993a35 (patch) | |
tree | 3c8b6ca0a2061972baa8df310acfa3daa2dd1f9e | |
parent | 477b07213a806c825f95fdfacd444028e1783dc2 (diff) | |
download | cmake-82e91e34872fd8fa394d14f1e4fac60f9e993a35.tar.gz |
cmComputeLinkDepends: Convert AddLinkEntries to a template
Allow the method to be called with a vector of any type that can be
converted to cmLinkItem.
-rw-r--r-- | Source/cmComputeLinkDepends.cxx | 5 | ||||
-rw-r--r-- | Source/cmComputeLinkDepends.h | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 6170e92e97..c13da50da7 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -553,15 +553,16 @@ void cmComputeLinkDepends::AddDirectLinkEntries() } //---------------------------------------------------------------------------- +template <typename T> void cmComputeLinkDepends::AddLinkEntries( - int depender_index, std::vector<cmLinkItem> const& libs) + int depender_index, std::vector<T> const& libs) { // Track inferred dependency sets implied by this list. std::map<int, DependSet> dependSets; // Loop over the libraries linked directly by the depender. - for(std::vector<cmLinkItem>::const_iterator li = libs.begin(); + for(typename std::vector<T>::const_iterator li = libs.begin(); li != libs.end(); ++li) { // Skip entries that will resolve to the target getting linked or diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h index 3207ecbf5d..a931726d9b 100644 --- a/Source/cmComputeLinkDepends.h +++ b/Source/cmComputeLinkDepends.h @@ -80,8 +80,8 @@ private: int AddLinkEntry(cmLinkItem const& item); void AddVarLinkEntries(int depender_index, const char* value); void AddDirectLinkEntries(); - void AddLinkEntries(int depender_index, - std::vector<cmLinkItem> const& libs); + template <typename T> + void AddLinkEntries(int depender_index, std::vector<T> const& libs); cmTarget const* FindTargetToLink(int depender_index, const std::string& name); |