summaryrefslogtreecommitdiffstats
path: root/Source/cmCoreTryCompile.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/cmCoreTryCompile.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/cmCoreTryCompile.cxx')
-rw-r--r--Source/cmCoreTryCompile.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index ab7b024..3987283 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -307,13 +307,13 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
std::string rulesOverrideBase = "CMAKE_USER_MAKE_RULES_OVERRIDE";
std::string rulesOverrideLang = rulesOverrideBase + "_" + *li;
if(const char* rulesOverridePath =
- this->Makefile->GetDefinition(rulesOverrideLang.c_str()))
+ this->Makefile->GetDefinition(rulesOverrideLang))
{
fprintf(fout, "set(%s \"%s\")\n",
rulesOverrideLang.c_str(), rulesOverridePath);
}
else if(const char* rulesOverridePath2 =
- this->Makefile->GetDefinition(rulesOverrideBase.c_str()))
+ this->Makefile->GetDefinition(rulesOverrideBase))
{
fprintf(fout, "set(%s \"%s\")\n",
rulesOverrideBase.c_str(), rulesOverridePath2);
@@ -325,7 +325,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
li != testLangs.end(); ++li)
{
std::string langFlags = "CMAKE_" + *li + "_FLAGS";
- const char* flags = this->Makefile->GetDefinition(langFlags.c_str());
+ const char* flags = this->Makefile->GetDefinition(langFlags);
fprintf(fout, "set(CMAKE_%s_FLAGS %s)\n", li->c_str(),
lg->EscapeForCMake(flags?flags:"").c_str());
fprintf(fout, "set(CMAKE_%s_FLAGS \"${CMAKE_%s_FLAGS}"
@@ -484,7 +484,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
std::string output;
// actually do the try compile now that everything is setup
int res = this->Makefile->TryCompile(sourceDirectory,
- this->BinaryDirectory.c_str(),
+ this->BinaryDirectory,
projectName,
targetName,
this->SrcFileSignature,
@@ -496,14 +496,14 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
}
// set the result var to the return value to indicate success or failure
- this->Makefile->AddCacheDefinition(argv[0].c_str(),
+ this->Makefile->AddCacheDefinition(argv[0],
(res == 0 ? "TRUE" : "FALSE"),
"Result of TRY_COMPILE",
cmCacheManager::INTERNAL);
if ( outputVariable.size() > 0 )
{
- this->Makefile->AddDefinition(outputVariable.c_str(), output.c_str());
+ this->Makefile->AddDefinition(outputVariable, output.c_str());
}
if (this->SrcFileSignature)
@@ -540,7 +540,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
if(!copyFileError.empty())
{
- this->Makefile->AddDefinition(copyFileError.c_str(),
+ this->Makefile->AddDefinition(copyFileError,
copyFileErrorMessage.c_str());
}
}