cmComputeLinkDepends: Convert AddLinkEntries to a template

Allow the method to be called with a vector of any type that can be
converted to cmLinkItem.
This commit is contained in:
Brad King 2014-06-30 10:28:08 -04:00
parent 477b07213a
commit 82e91e3487
2 changed files with 5 additions and 4 deletions

View File

@ -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

View File

@ -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);