summaryrefslogtreecommitdiffstats
path: root/Source/cmTargetLinkLibrariesCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmTargetLinkLibrariesCommand.cxx')
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx23
1 files changed, 11 insertions, 12 deletions
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 95a2cba..56e1338 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -39,7 +39,7 @@ bool cmTargetLinkLibrariesCommand
// Lookup the target for which libraries are specified.
this->Target =
this->Makefile->GetCMakeInstance()
- ->GetGlobalGenerator()->FindTarget(0, args[0].c_str());
+ ->GetGlobalGenerator()->FindTarget(args[0]);
if(!this->Target)
{
cmake::MessageType t = cmake::FATAL_ERROR; // fail by default
@@ -70,7 +70,6 @@ bool cmTargetLinkLibrariesCommand
GetRequiredPolicyError(cmPolicies::CMP0016);
break;
case cmPolicies::NEW: // NEW behavior prints the error.
- default:
break;
}
}
@@ -125,7 +124,7 @@ bool cmTargetLinkLibrariesCommand
e <<
"Utility target \"" << this->Target->GetName() << "\" " << modal
<< " not be used as the target of a target_link_libraries call.";
- this->Makefile->IssueMessage(messageType, e.str().c_str());
+ this->Makefile->IssueMessage(messageType, e.str());
if(messageType == cmake::FATAL_ERROR)
{
return false;
@@ -273,7 +272,7 @@ bool cmTargetLinkLibrariesCommand
{
// The link type was specified by the previous argument.
haveLLT = false;
- if (!this->HandleLibrary(args[i].c_str(), llt))
+ if (!this->HandleLibrary(args[i], llt))
{
return false;
}
@@ -290,7 +289,7 @@ bool cmTargetLinkLibrariesCommand
std::string linkType = args[0];
linkType += "_LINK_TYPE";
const char* linkTypeString =
- this->Makefile->GetDefinition( linkType.c_str() );
+ this->Makefile->GetDefinition( linkType );
if(linkTypeString)
{
if(strcmp(linkTypeString, "debug") == 0)
@@ -302,7 +301,7 @@ bool cmTargetLinkLibrariesCommand
llt = cmTarget::OPTIMIZED;
}
}
- if (!this->HandleLibrary(args[i].c_str(), llt))
+ if (!this->HandleLibrary(args[i], llt))
{
return false;
}
@@ -353,7 +352,7 @@ cmTargetLinkLibrariesCommand
//----------------------------------------------------------------------------
bool
-cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
+cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
cmTarget::LinkLibraryType llt)
{
if(this->Target->GetType() == cmTarget::INTERFACE_LIBRARY
@@ -409,7 +408,7 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
sig == cmTarget::KeywordTLLSignature
? cmTarget::PlainTLLSignature
: cmTarget::KeywordTLLSignature);
- this->Makefile->IssueMessage(messageType, e.str().c_str());
+ this->Makefile->IssueMessage(messageType, e.str());
if(messageType == cmake::FATAL_ERROR)
{
return false;
@@ -481,13 +480,13 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
{
prop = "LINK_INTERFACE_LIBRARIES_";
prop += *i;
- this->Target->AppendProperty(prop.c_str(), lib);
+ this->Target->AppendProperty(prop, lib.c_str());
}
}
if(llt == cmTarget::OPTIMIZED || llt == cmTarget::GENERAL)
{
// Put in the non-DEBUG configuration interfaces.
- this->Target->AppendProperty("LINK_INTERFACE_LIBRARIES", lib);
+ this->Target->AppendProperty("LINK_INTERFACE_LIBRARIES", lib.c_str());
// Make sure the DEBUG configuration interfaces exist so that the
// general one will not be used as a fall-back.
@@ -496,9 +495,9 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
{
prop = "LINK_INTERFACE_LIBRARIES_";
prop += *i;
- if(!this->Target->GetProperty(prop.c_str()))
+ if(!this->Target->GetProperty(prop))
{
- this->Target->SetProperty(prop.c_str(), "");
+ this->Target->SetProperty(prop, "");
}
}
}