mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-26 00:00:39 -05:00
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.
This commit is contained in:
+13
-13
@@ -162,7 +162,7 @@ bool cmTryRunCommand
|
||||
// now put the output into the variables
|
||||
if(this->RunOutputVariable.size())
|
||||
{
|
||||
this->Makefile->AddDefinition(this->RunOutputVariable.c_str(),
|
||||
this->Makefile->AddDefinition(this->RunOutputVariable,
|
||||
runOutputContents.c_str());
|
||||
}
|
||||
|
||||
@@ -171,12 +171,12 @@ bool cmTryRunCommand
|
||||
// if the TryCompileCore saved output in this outputVariable then
|
||||
// prepend that output to this output
|
||||
const char* compileOutput
|
||||
= this->Makefile->GetDefinition(this->OutputVariable.c_str());
|
||||
= this->Makefile->GetDefinition(this->OutputVariable);
|
||||
if (compileOutput)
|
||||
{
|
||||
runOutputContents = std::string(compileOutput) + runOutputContents;
|
||||
}
|
||||
this->Makefile->AddDefinition(this->OutputVariable.c_str(),
|
||||
this->Makefile->AddDefinition(this->OutputVariable,
|
||||
runOutputContents.c_str());
|
||||
}
|
||||
}
|
||||
@@ -214,7 +214,7 @@ void cmTryRunCommand::RunExecutable(const std::string& runArgs,
|
||||
{
|
||||
strcpy(retChar, "FAILED_TO_RUN");
|
||||
}
|
||||
this->Makefile->AddCacheDefinition(this->RunResultVariable.c_str(), retChar,
|
||||
this->Makefile->AddCacheDefinition(this->RunResultVariable, retChar,
|
||||
"Result of TRY_RUN",
|
||||
cmCacheManager::INTERNAL);
|
||||
}
|
||||
@@ -235,10 +235,10 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
|
||||
copyDest += cmake::GetCMakeFilesDirectory();
|
||||
copyDest += "/";
|
||||
copyDest += cmSystemTools::GetFilenameWithoutExtension(
|
||||
this->OutputFile.c_str());
|
||||
this->OutputFile);
|
||||
copyDest += "-";
|
||||
copyDest += this->RunResultVariable;
|
||||
copyDest += cmSystemTools::GetFilenameExtension(this->OutputFile.c_str());
|
||||
copyDest += cmSystemTools::GetFilenameExtension(this->OutputFile);
|
||||
cmSystemTools::CopyFileAlways(this->OutputFile.c_str(), copyDest.c_str());
|
||||
|
||||
std::string resultFileName = this->Makefile->GetHomeOutputDirectory();
|
||||
@@ -250,7 +250,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
|
||||
std::string internalRunOutputName=this->RunResultVariable+"__TRYRUN_OUTPUT";
|
||||
bool error = false;
|
||||
|
||||
if (this->Makefile->GetDefinition(this->RunResultVariable.c_str()) == 0)
|
||||
if (this->Makefile->GetDefinition(this->RunResultVariable) == 0)
|
||||
{
|
||||
// if the variables doesn't exist, create it with a helpful error text
|
||||
// and mark it as advanced
|
||||
@@ -258,7 +258,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
|
||||
comment += "Run result of TRY_RUN(), indicates whether the executable "
|
||||
"would have been able to run on its target platform.\n";
|
||||
comment += detailsString;
|
||||
this->Makefile->AddCacheDefinition(this->RunResultVariable.c_str(),
|
||||
this->Makefile->AddCacheDefinition(this->RunResultVariable,
|
||||
"PLEASE_FILL_OUT-FAILED_TO_RUN",
|
||||
comment.c_str(),
|
||||
cmCacheManager::STRING);
|
||||
@@ -276,7 +276,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
|
||||
// is the output from the executable used ?
|
||||
if (out!=0)
|
||||
{
|
||||
if (this->Makefile->GetDefinition(internalRunOutputName.c_str()) == 0)
|
||||
if (this->Makefile->GetDefinition(internalRunOutputName) == 0)
|
||||
{
|
||||
// if the variables doesn't exist, create it with a helpful error text
|
||||
// and mark it as advanced
|
||||
@@ -285,7 +285,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
|
||||
"would have printed on stdout and stderr on its target platform.\n";
|
||||
comment += detailsString;
|
||||
|
||||
this->Makefile->AddCacheDefinition(internalRunOutputName.c_str(),
|
||||
this->Makefile->AddCacheDefinition(internalRunOutputName,
|
||||
"PLEASE_FILL_OUT-NOTFOUND",
|
||||
comment.c_str(),
|
||||
cmCacheManager::STRING);
|
||||
@@ -355,13 +355,13 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
|
||||
file << comment << "\n\n";
|
||||
|
||||
file << "set( " << this->RunResultVariable << " \n \""
|
||||
<< this->Makefile->GetDefinition(this->RunResultVariable.c_str())
|
||||
<< this->Makefile->GetDefinition(this->RunResultVariable)
|
||||
<< "\"\n CACHE STRING \"Result from TRY_RUN\" FORCE)\n\n";
|
||||
|
||||
if (out!=0)
|
||||
{
|
||||
file << "set( " << internalRunOutputName << " \n \""
|
||||
<< this->Makefile->GetDefinition(internalRunOutputName.c_str())
|
||||
<< this->Makefile->GetDefinition(internalRunOutputName)
|
||||
<< "\"\n CACHE STRING \"Output from TRY_RUN\" FORCE)\n\n";
|
||||
}
|
||||
file.close();
|
||||
@@ -383,6 +383,6 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
|
||||
|
||||
if (out!=0)
|
||||
{
|
||||
(*out) = this->Makefile->GetDefinition(internalRunOutputName.c_str());
|
||||
(*out) = this->Makefile->GetDefinition(internalRunOutputName);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user