From 47ab3ca64105cdfcc7b57ffe037aa93d8226b945 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 16 Jun 2014 10:09:46 -0400 Subject: cmTarget: Constify GetLinkImplementationClosure results Populate a vector of "cmTarget const*" instead of "cmTarget*". --- Source/cmTarget.cxx | 20 ++++++++++---------- Source/cmTarget.h | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 96f28af..4ef481a 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -177,7 +177,7 @@ public: CachedLinkInterfaceSourcesEntries; mutable std::map > CachedLinkInterfaceCompileFeaturesEntries; - mutable std::map > + mutable std::map > CachedLinkImplementationClosure; mutable std::map CacheLinkInterfaceIncludeDirectoriesDone; @@ -5219,7 +5219,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt, assert((impliedByUse ^ explicitlySet) || (!impliedByUse && !explicitlySet)); - std::vector const& deps = + std::vector const& deps = tgt->GetLinkImplementationClosure(config); if(deps.empty()) @@ -5245,7 +5245,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt, report += "\" property not set.\n"; } - for(std::vector::const_iterator li = + for(std::vector::const_iterator li = deps.begin(); li != deps.end(); ++li) { @@ -5435,7 +5435,7 @@ bool isLinkDependentProperty(cmTarget const* tgt, const std::string &p, const std::string& interfaceProperty, const std::string& config) { - std::vector const& deps = + std::vector const& deps = tgt->GetLinkImplementationClosure(config); if(deps.empty()) @@ -5443,8 +5443,7 @@ bool isLinkDependentProperty(cmTarget const* tgt, const std::string &p, return false; } - for(std::vector::const_iterator li = - deps.begin(); + for(std::vector::const_iterator li = deps.begin(); li != deps.end(); ++li) { const char *prop = (*li)->GetProperty(interfaceProperty); @@ -6151,7 +6150,8 @@ cmTarget::GetImportLinkInterface(const std::string& config, void processILibs(const std::string& config, cmTarget const* headTarget, std::string const& name, - std::vector& tgts, std::set& emitted) + std::vector& tgts, + std::set& emitted) { cmTarget* tgt = headTarget->GetMakefile() ->FindTargetToUse(name); @@ -6172,15 +6172,15 @@ void processILibs(const std::string& config, } //---------------------------------------------------------------------------- -std::vector const& +std::vector const& cmTarget::GetLinkImplementationClosure(const std::string& config) const { - std::vector& tgts = + std::vector& tgts = this->Internal->CachedLinkImplementationClosure[config]; if(!this->Internal->CacheLinkImplementationClosureDone[config]) { this->Internal->CacheLinkImplementationClosureDone[config] = true; - std::set emitted; + std::set emitted; cmTarget::LinkImplementation const* impl = this->GetLinkImplementationLibraries(config); diff --git a/Source/cmTarget.h b/Source/cmTarget.h index fae1bbb..cb68559 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -273,7 +273,7 @@ public: void GetTransitivePropertyTargets(const std::string& config, cmTarget const* headTarget, std::vector &libs) const; - std::vector const& + std::vector const& GetLinkImplementationClosure(const std::string& config) const; /** The link implementation specifies the direct library -- cgit v0.12