summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkInformation.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-03-10 23:04:11 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-03-11 14:03:50 (GMT)
commit21c573f682f9eafbc8d4402f7febbb1bec1cb86a (patch)
tree8c9e0b913c7de5737a770430064ff5533a19477d /Source/cmComputeLinkInformation.cxx
parente21ffaf8fe5499426604b4ebb9cd08798ee6107c (diff)
downloadCMake-21c573f682f9eafbc8d4402f7febbb1bec1cb86a.zip
CMake-21c573f682f9eafbc8d4402f7febbb1bec1cb86a.tar.gz
CMake-21c573f682f9eafbc8d4402f7febbb1bec1cb86a.tar.bz2
Remove some c_str() calls.
Use the clang RemoveCStrCalls tool to automatically migrate the code. This was only run on linux, so does not have any positive or negative effect on other platforms.
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r--Source/cmComputeLinkInformation.cxx38
1 files changed, 19 insertions, 19 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 62eaec2..ea8536f 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -293,7 +293,7 @@ cmComputeLinkInformation
std::string loader_flag_var = "CMAKE_SHARED_MODULE_LOADER_";
loader_flag_var += this->LinkLanguage;
loader_flag_var += "_FLAG";
- this->LoaderFlag = this->Makefile->GetDefinition(loader_flag_var.c_str());
+ this->LoaderFlag = this->Makefile->GetDefinition(loader_flag_var);
}
// Get options needed to link libraries.
@@ -317,8 +317,8 @@ cmComputeLinkInformation
rtVar += this->LinkLanguage;
rtVar += "_FLAG";
std::string rtSepVar = rtVar + "_SEP";
- this->RuntimeFlag = this->Makefile->GetSafeDefinition(rtVar.c_str());
- this->RuntimeSep = this->Makefile->GetSafeDefinition(rtSepVar.c_str());
+ this->RuntimeFlag = this->Makefile->GetSafeDefinition(rtVar);
+ this->RuntimeSep = this->Makefile->GetSafeDefinition(rtSepVar);
this->RuntimeAlways =
(this->Makefile->
GetSafeDefinition("CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH"));
@@ -330,7 +330,7 @@ cmComputeLinkInformation
rlVar += "_RPATH_LINK_";
rlVar += this->LinkLanguage;
rlVar += "_FLAG";
- this->RPathLinkFlag = this->Makefile->GetSafeDefinition(rlVar.c_str());
+ this->RPathLinkFlag = this->Makefile->GetSafeDefinition(rlVar);
}
// Check if we need to include the runtime search path at link time.
@@ -338,7 +338,7 @@ cmComputeLinkInformation
std::string var = "CMAKE_SHARED_LIBRARY_LINK_";
var += this->LinkLanguage;
var += "_WITH_RUNTIME_PATH";
- this->LinkWithRuntimePath = this->Makefile->IsOn(var.c_str());
+ this->LinkWithRuntimePath = this->Makefile->IsOn(var);
}
// Check the platform policy for missing soname case.
@@ -505,7 +505,7 @@ bool cmComputeLinkInformation::Compute()
}
// Compute the ordered link line items.
- cmComputeLinkDepends cld(this->Target, this->Config.c_str(),
+ cmComputeLinkDepends cld(this->Target, this->Config,
this->HeadTarget);
cld.SetOldLinkDirMode(this->OldLinkDirMode);
cmComputeLinkDepends::EntryVector const& linkEntries = cld.Compute();
@@ -593,7 +593,7 @@ void cmComputeLinkInformation::AddImplicitLinkInfo(std::string const& lang)
std::string libVar = "CMAKE_";
libVar += lang;
libVar += "_IMPLICIT_LINK_LIBRARIES";
- if(const char* libs = this->Makefile->GetDefinition(libVar.c_str()))
+ if(const char* libs = this->Makefile->GetDefinition(libVar))
{
std::vector<std::string> libsVec;
cmSystemTools::ExpandListArgument(libs, libsVec);
@@ -602,7 +602,7 @@ void cmComputeLinkInformation::AddImplicitLinkInfo(std::string const& lang)
{
if(this->ImplicitLinkLibs.find(*i) == this->ImplicitLinkLibs.end())
{
- this->AddItem(i->c_str(), 0);
+ this->AddItem(*i, 0);
}
}
}
@@ -612,7 +612,7 @@ void cmComputeLinkInformation::AddImplicitLinkInfo(std::string const& lang)
std::string dirVar = "CMAKE_";
dirVar += lang;
dirVar += "_IMPLICIT_LINK_DIRECTORIES";
- if(const char* dirs = this->Makefile->GetDefinition(dirVar.c_str()))
+ if(const char* dirs = this->Makefile->GetDefinition(dirVar))
{
std::vector<std::string> dirsVec;
cmSystemTools::ExpandListArgument(dirs, dirsVec);
@@ -820,7 +820,7 @@ void cmComputeLinkInformation::ComputeLinkTypeInfo()
static_link_type_flag_var += this->LinkLanguage;
static_link_type_flag_var += "_FLAGS";
static_link_type_flag =
- this->Makefile->GetDefinition(static_link_type_flag_var.c_str());
+ this->Makefile->GetDefinition(static_link_type_flag_var);
std::string shared_link_type_flag_var = "CMAKE_";
shared_link_type_flag_var += target_type_str;
@@ -828,7 +828,7 @@ void cmComputeLinkInformation::ComputeLinkTypeInfo()
shared_link_type_flag_var += this->LinkLanguage;
shared_link_type_flag_var += "_FLAGS";
shared_link_type_flag =
- this->Makefile->GetDefinition(shared_link_type_flag_var.c_str());
+ this->Makefile->GetDefinition(shared_link_type_flag_var);
}
// We can support link type switching only if all needed flags are
@@ -1370,7 +1370,7 @@ void cmComputeLinkInformation::AddFrameworkItem(std::string const& item)
// Add the item using the -framework option.
this->Items.push_back(Item("-framework", false));
- fw = this->LocalGenerator->EscapeForShell(fw.c_str());
+ fw = this->LocalGenerator->EscapeForShell(fw);
this->Items.push_back(Item(fw, false));
}
@@ -1419,7 +1419,7 @@ void cmComputeLinkInformation::ComputeFrameworkInfo()
implicitDirVar += this->LinkLanguage;
implicitDirVar += "_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES";
if(const char* implicitDirs =
- this->Makefile->GetDefinition(implicitDirVar.c_str()))
+ this->Makefile->GetDefinition(implicitDirVar))
{
cmSystemTools::ExpandListArgument(implicitDirs, implicitDirVec);
}
@@ -1506,9 +1506,9 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item,
// Print the warning at most once for this item.
std::string wid = "CMP0008-WARNING-GIVEN-";
wid += item;
- if(!this->CMakeInstance->GetPropertyAsBool(wid.c_str()))
+ if(!this->CMakeInstance->GetPropertyAsBool(wid))
{
- this->CMakeInstance->SetProperty(wid.c_str(), "1");
+ this->CMakeInstance->SetProperty(wid, "1");
cmOStringStream w;
w << (this->Makefile->GetPolicies()
->GetPolicyWarning(cmPolicies::CMP0008)) << "\n"
@@ -1692,7 +1692,7 @@ void cmComputeLinkInformation::LoadImplicitLinkInfo()
implicitDirVar += this->LinkLanguage;
implicitDirVar += "_IMPLICIT_LINK_DIRECTORIES";
if(const char* implicitDirs =
- this->Makefile->GetDefinition(implicitDirVar.c_str()))
+ this->Makefile->GetDefinition(implicitDirVar))
{
cmSystemTools::ExpandListArgument(implicitDirs, implicitDirVec);
}
@@ -1710,7 +1710,7 @@ void cmComputeLinkInformation::LoadImplicitLinkInfo()
implicitLibVar += this->LinkLanguage;
implicitLibVar += "_IMPLICIT_LINK_LIBRARIES";
if(const char* implicitLibs =
- this->Makefile->GetDefinition(implicitLibVar.c_str()))
+ this->Makefile->GetDefinition(implicitLibVar))
{
cmSystemTools::ExpandListArgument(implicitLibs, implicitLibVec);
}
@@ -1978,11 +1978,11 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
{
std::string useVar = "CMAKE_" + *li +
"_USE_IMPLICIT_LINK_DIRECTORIES_IN_RUNTIME_PATH";
- if(this->Makefile->IsOn(useVar.c_str()))
+ if(this->Makefile->IsOn(useVar))
{
std::string dirVar = "CMAKE_" + *li +
"_IMPLICIT_LINK_DIRECTORIES";
- if(const char* dirs = this->Makefile->GetDefinition(dirVar.c_str()))
+ if(const char* dirs = this->Makefile->GetDefinition(dirVar))
{
cmCLI_ExpandListUnique(dirs, runtimeDirs, emitted);
}