From 82e91e34872fd8fa394d14f1e4fac60f9e993a35 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 30 Jun 2014 10:28:08 -0400 Subject: cmComputeLinkDepends: Convert AddLinkEntries to a template Allow the method to be called with a vector of any type that can be converted to cmLinkItem. --- Source/cmComputeLinkDepends.cxx | 5 +++-- Source/cmComputeLinkDepends.h | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 6170e92..c13da50 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -553,15 +553,16 @@ void cmComputeLinkDepends::AddDirectLinkEntries() } //---------------------------------------------------------------------------- +template void cmComputeLinkDepends::AddLinkEntries( - int depender_index, std::vector const& libs) + int depender_index, std::vector const& libs) { // Track inferred dependency sets implied by this list. std::map dependSets; // Loop over the libraries linked directly by the depender. - for(std::vector::const_iterator li = libs.begin(); + for(typename std::vector::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 3207ecb..a931726 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 const& libs); + template + void AddLinkEntries(int depender_index, std::vector const& libs); cmTarget const* FindTargetToLink(int depender_index, const std::string& name); -- cgit v0.12