diff options
author | Rolf Eike Beer <kde@opensource.sf-tec.de> | 2014-01-15 22:56:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-01-16 14:28:29 (GMT) |
commit | c768e398f9c29aa12680fe89a52ce9b00eff2866 (patch) | |
tree | d60f39ce1c2b37557ec83d9e91c64ff9147f94fe /Source/cmTarget.cxx | |
parent | 4c7bac45ae1347ebea6709a7fdf59f50ff7bbb15 (diff) | |
download | CMake-c768e398f9c29aa12680fe89a52ce9b00eff2866.zip CMake-c768e398f9c29aa12680fe89a52ce9b00eff2866.tar.gz CMake-c768e398f9c29aa12680fe89a52ce9b00eff2866.tar.bz2 |
cmMakefile: make some methods take const std::string& instead of const char*
Most callers already have a std::string, on which they called c_str() to pass it
into these methods, which internally converted it back to std::string. Pass a
std::string directly to these methods now, avoiding all these conversions.
Those methods that only pass in a const char* will get the conversion to
std::string now only once.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 24fa0c5..21f8d4c 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1681,14 +1681,14 @@ static void processIncludeDirectories(cmTarget const* tgt, evaluatedTargetName = cge->Evaluate(mf, config, false, tgt, 0, 0); } - cmTarget *dependentTarget = mf->FindTargetToUse(targetName.c_str()); + cmTarget *dependentTarget = mf->FindTargetToUse(targetName); const bool fromImported = dependentTarget && dependentTarget->IsImported(); cmTarget *evaluatedDependentTarget = (targetName != evaluatedTargetName) - ? mf->FindTargetToUse(evaluatedTargetName.c_str()) + ? mf->FindTargetToUse(evaluatedTargetName) : 0; targetName = evaluatedTargetName; @@ -1860,7 +1860,7 @@ cmTarget::GetIncludeDirectories(const char *config) const ge.Parse(it->Value); std::string result = cge->Evaluate(this->Makefile, config, false, this, 0, 0); - if (!this->Makefile->FindTargetToUse(result.c_str())) + if (!this->Makefile->FindTargetToUse(result)) { continue; } @@ -2089,7 +2089,7 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result, ge.Parse(it->Value); std::string targetResult = cge->Evaluate(this->Makefile, config, false, this, 0, 0); - if (!this->Makefile->FindTargetToUse(targetResult.c_str())) + if (!this->Makefile->FindTargetToUse(targetResult)) { continue; } @@ -2202,7 +2202,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list, ge.Parse(it->Value); std::string targetResult = cge->Evaluate(this->Makefile, config, false, this, 0, 0); - if (!this->Makefile->FindTargetToUse(targetResult.c_str())) + if (!this->Makefile->FindTargetToUse(targetResult)) { continue; } @@ -2861,7 +2861,7 @@ public: for(std::vector<std::string>::const_iterator li = iface->Libraries.begin(); li != iface->Libraries.end(); ++li) { - this->Visit(mf->FindTargetToUse(li->c_str())); + this->Visit(mf->FindTargetToUse(*li)); } } private: @@ -2969,7 +2969,7 @@ void cmTarget::ComputeLinkClosure(const char* config, LinkClosure& lc, for(std::vector<std::string>::const_iterator li = impl->Libraries.begin(); li != impl->Libraries.end(); ++li) { - cll.Visit(this->Makefile->FindTargetToUse(li->c_str())); + cll.Visit(this->Makefile->FindTargetToUse(*li)); } // Store the transitive closure of languages. @@ -5414,7 +5414,7 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface, { if(emitted.insert(*li).second) { - if(cmTarget* tgt = this->Makefile->FindTargetToUse(li->c_str())) + if(cmTarget* tgt = this->Makefile->FindTargetToUse(*li)) { // This is a runtime dependency on another shared library. if(tgt->GetType() == cmTarget::SHARED_LIBRARY) @@ -5624,7 +5624,7 @@ void cmTarget::ComputeLinkImplementation(const char* config, } continue; } - cmTarget *tgt = this->Makefile->FindTargetToUse(li->c_str()); + cmTarget *tgt = this->Makefile->FindTargetToUse(*li); if(!tgt && std::string(item).find("::") != std::string::npos) { @@ -5695,7 +5695,7 @@ void cmTarget::ComputeLinkImplementation(const char* config, i = this->ObjectLibraries.begin(); i != this->ObjectLibraries.end(); ++i) { - if(cmTarget* objLib = this->Makefile->FindTargetToUse(i->c_str())) + if(cmTarget* objLib = this->Makefile->FindTargetToUse(*i)) { if(objLib->GetType() == cmTarget::OBJECT_LIBRARY) { |