diff options
author | Brad King <brad.king@kitware.com> | 2014-06-30 14:38:59 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-07-07 12:52:39 (GMT) |
commit | 848c8ccf18e325e0d2833ac468f733261832feca (patch) | |
tree | 543d9c163c087b5e1dacd1a0a9607ebaaab64f7d | |
parent | f85ccf23eeec08fff46c0788b8ee357b3f5220e4 (diff) | |
download | CMake-848c8ccf18e325e0d2833ac468f733261832feca.zip CMake-848c8ccf18e325e0d2833ac468f733261832feca.tar.gz CMake-848c8ccf18e325e0d2833ac468f733261832feca.tar.bz2 |
cmTarget: Refactor LinkImplementation to allow more information
Create a cmLinkImplItem class derived from cmLinkItem so more
information can be added to link implementation entries than link
interface entries. Convert the LinkImplementation Libraries member to
hold it. Update client sites accordingly.
-rw-r--r-- | Source/cmComputeTargetDepends.cxx | 2 | ||||
-rw-r--r-- | Source/cmGeneratorExpressionEvaluator.cxx | 4 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 4 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 19 | ||||
-rw-r--r-- | Source/cmTarget.h | 12 |
5 files changed, 27 insertions, 14 deletions
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index 3929af4..75d3967 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -255,7 +255,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index) // A target should not depend on itself. emitted.insert(depender->GetName()); - for(std::vector<cmLinkItem>::const_iterator + for(std::vector<cmLinkImplItem>::const_iterator lib = impl->Libraries.begin(); lib != impl->Libraries.end(); ++lib) { diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index cf112ec..13eac3b 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -844,7 +844,7 @@ getLinkedTargetsContent( std::string getLinkedTargetsContent( - std::vector<cmLinkItem> const &libraries, + std::vector<cmLinkImplItem> const &libraries, cmTarget const* target, cmTarget const* headTarget, cmGeneratorExpressionContext *context, @@ -852,7 +852,7 @@ getLinkedTargetsContent( const std::string &interfacePropertyName) { std::vector<cmTarget const*> tgts; - for (std::vector<cmLinkItem>::const_iterator + for (std::vector<cmLinkImplItem>::const_iterator it = libraries.begin(); it != libraries.end(); ++it) { diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index fd82d17..eccb06a 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -475,8 +475,8 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir, } std::set<cmTarget const*> uniqueDeps; - for(std::vector<cmLinkItem>::const_iterator li = impl->Libraries.begin(); - li != impl->Libraries.end(); ++li) + for(std::vector<cmLinkImplItem>::const_iterator + li = impl->Libraries.begin(); li != impl->Libraries.end(); ++li) { cmTarget const* tgt = li->Target; if (!tgt) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index d27293a..94b339b 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2281,7 +2281,7 @@ cmTarget::GetIncludeDirectories(const std::string& config) const if(this->Makefile->IsOn("APPLE")) { LinkImplementation const* impl = this->GetLinkImplementation(config); - for(std::vector<cmLinkItem>::const_iterator + for(std::vector<cmLinkImplItem>::const_iterator it = impl->Libraries.begin(); it != impl->Libraries.end(); ++it) { @@ -3675,7 +3675,8 @@ void cmTarget::ComputeLinkClosure(const std::string& config, // Add interface languages from linked targets. cmTargetCollectLinkLanguages cll(this, config, languages, this); - for(std::vector<cmLinkItem>::const_iterator li = impl->Libraries.begin(); + for(std::vector<cmLinkImplItem>::const_iterator + li = impl->Libraries.begin(); li != impl->Libraries.end(); ++li) { cll.Visit(*li); @@ -6242,7 +6243,8 @@ cmTarget::GetLinkImplementationClosure(const std::string& config) const cmTarget::LinkImplementation const* impl = this->GetLinkImplementationLibraries(config); - for(std::vector<cmLinkItem>::const_iterator it = impl->Libraries.begin(); + for(std::vector<cmLinkImplItem>::const_iterator + it = impl->Libraries.begin(); it != impl->Libraries.end(); ++it) { processILibs(config, this, *it, tgts , emitted); @@ -6383,7 +6385,8 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config, // The link implementation is the default link interface. LinkImplementation const* impl = this->GetLinkImplementationLibrariesInternal(config, headTarget); - iface.Libraries = impl->Libraries; + std::copy(impl->Libraries.begin(), impl->Libraries.end(), + std::back_inserter(iface.Libraries)); if(this->PolicyStatusCMP0022 == cmPolicies::WARN && !this->Internal->PolicyWarnedCMP0022 && !usage_requirements_only) { @@ -6397,12 +6400,12 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config, headTarget, usage_requirements_only, ifaceLibs); } - if (ifaceLibs != impl->Libraries) + if (ifaceLibs != iface.Libraries) { std::string oldLibraries; std::string newLibraries; const char *sep = ""; - for(std::vector<cmLinkItem>::const_iterator it + for(std::vector<cmLinkImplItem>::const_iterator it = impl->Libraries.begin(); it != impl->Libraries.end(); ++it) { oldLibraries += sep; @@ -6470,7 +6473,7 @@ void cmTargetInternals::ComputeLinkInterface(cmTarget const* thisTarget, { cmTarget::LinkImplementation const* impl = thisTarget->GetLinkImplementation(config); - for(std::vector<cmLinkItem>::const_iterator + for(std::vector<cmLinkImplItem>::const_iterator li = impl->Libraries.begin(); li != impl->Libraries.end(); ++li) { if(emitted.insert(*li).second) @@ -6674,7 +6677,7 @@ void cmTarget::ComputeLinkImplementation(const std::string& config, // The entry is meant for this configuration. impl.Libraries.push_back( - cmLinkItem(name, this->FindTargetToLink(name))); + cmLinkImplItem(name, this->FindTargetToLink(name))); } std::set<std::string> const& seenProps = cge->GetSeenTargetProperties(); diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 9d1f966..8578c51 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -54,6 +54,16 @@ public: cmLinkItem(cmLinkItem const& r): std_string(r), Target(r.Target) {} cmTarget const* Target; }; +class cmLinkImplItem: public cmLinkItem +{ +public: + cmLinkImplItem(): cmLinkItem() {} + cmLinkImplItem(std::string const& n, + cmTarget const* t): + cmLinkItem(n, t) {} + cmLinkImplItem(cmLinkImplItem const& r): + cmLinkItem(r) {} +}; struct cmTargetLinkInformationMap: public std::map<std::string, cmComputeLinkInformation*> @@ -296,7 +306,7 @@ public: std::vector<std::string> Languages; // Libraries linked directly in this configuration. - std::vector<cmLinkItem> Libraries; + std::vector<cmLinkImplItem> Libraries; // Libraries linked directly in other configurations. // Needed only for OLD behavior of CMP0003. |