summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-05-05 21:50:39 +0200
committerStephen Kelly <steveire@gmail.com>2015-05-14 20:30:09 +0200
commit9486769866661e3aa76dd588ca5a7466e2969dc3 (patch)
tree56cbe397c6a522aaf84990c5e8603cba81d5a37f /Source
parenta3139d4b1512195485cde49d919a13cdaec62660 (diff)
downloadcmake-9486769866661e3aa76dd588ca5a7466e2969dc3.tar.gz
Don't use a cmLocalGenerator instance to call static methods.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCoreTryCompile.cxx8
-rw-r--r--Source/cmIfCommand.cxx9
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx7
-rw-r--r--Source/cmMakefileTargetGenerator.cxx4
-rw-r--r--Source/cmTestGenerator.cxx16
5 files changed, 21 insertions, 23 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 1109aca5a0..dd276a8a1d 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -242,8 +242,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
}
// Detect languages to enable.
- cmLocalGenerator* lg = this->Makefile->GetLocalGenerator();
- cmGlobalGenerator* gg = lg->GetGlobalGenerator();
+ cmGlobalGenerator* gg = this->Makefile->GetGlobalGenerator();
std::set<std::string> testLangs;
for(std::vector<std::string>::iterator si = sources.begin();
si != sources.end(); ++si)
@@ -323,7 +322,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
std::string langFlags = "CMAKE_" + *li + "_FLAGS";
const char* flags = this->Makefile->GetDefinition(langFlags);
fprintf(fout, "set(CMAKE_%s_FLAGS %s)\n", li->c_str(),
- lg->EscapeForCMake(flags?flags:"").c_str());
+ cmLocalGenerator::EscapeForCMake(flags?flags:"").c_str());
fprintf(fout, "set(CMAKE_%s_FLAGS \"${CMAKE_%s_FLAGS}"
" ${COMPILE_DEFINITIONS}\")\n", li->c_str(), li->c_str());
}
@@ -356,7 +355,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
const char* exeLinkFlags =
this->Makefile->GetDefinition("CMAKE_EXE_LINKER_FLAGS");
fprintf(fout, "set(CMAKE_EXE_LINKER_FLAGS %s)\n",
- lg->EscapeForCMake(exeLinkFlags?exeLinkFlags:"").c_str());
+ cmLocalGenerator::EscapeForCMake(
+ exeLinkFlags ? exeLinkFlags : "").c_str());
} break;
}
fprintf(fout, "set(CMAKE_EXE_LINKER_FLAGS \"${CMAKE_EXE_LINKER_FLAGS}"
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index 6dea5c17cf..3551f837e1 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -20,15 +20,14 @@
static std::string cmIfCommandError(
- cmMakefile* mf, std::vector<cmExpandedCommandArgument> const& args)
+ std::vector<cmExpandedCommandArgument> const& args)
{
- cmLocalGenerator* lg = mf->GetLocalGenerator();
std::string err = "given arguments:\n ";
for(std::vector<cmExpandedCommandArgument>::const_iterator i = args.begin();
i != args.end(); ++i)
{
err += " ";
- err += lg->EscapeForCMake(i->GetValue());
+ err += cmLocalGenerator::EscapeForCMake(i->GetValue());
}
err += "\n";
return err;
@@ -118,7 +117,7 @@ IsFunctionBlocked(const cmListFileFunction& lff,
if (!errorString.empty())
{
- std::string err = cmIfCommandError(&mf, expandedArguments);
+ std::string err = cmIfCommandError(expandedArguments);
err += errorString;
mf.IssueMessage(messType, err);
if (messType == cmake::FATAL_ERROR)
@@ -206,7 +205,7 @@ bool cmIfCommand
if (!errorString.empty())
{
- std::string err = cmIfCommandError(this->Makefile, expandedArguments);
+ std::string err = cmIfCommandError(expandedArguments);
err += errorString;
if (status == cmake::FATAL_ERROR)
{
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index bf6fb61404..faeb9db7a2 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1261,7 +1261,7 @@ cmLocalUnixMakefileGenerator3
f != files.end(); ++f)
{
std::string fc = this->Convert(*f,START_OUTPUT,UNCHANGED);
- fout << " " << this->EscapeForCMake(fc) << "\n";
+ fout << " " << cmLocalGenerator::EscapeForCMake(fc) << "\n";
}
fout << ")\n";
}
@@ -2060,7 +2060,7 @@ void cmLocalUnixMakefileGenerator3
di != defines.end(); ++di)
{
cmakefileStream
- << " " << this->EscapeForCMake(*di) << "\n";
+ << " " << cmLocalGenerator::EscapeForCMake(*di) << "\n";
}
cmakefileStream
<< " )\n";
@@ -2113,7 +2113,8 @@ void cmLocalUnixMakefileGenerator3
for(std::vector<std::string>::const_iterator tri = transformRules.begin();
tri != transformRules.end(); ++tri)
{
- cmakefileStream << " " << this->EscapeForCMake(*tri) << "\n";
+ cmakefileStream << " "
+ << cmLocalGenerator::EscapeForCMake(*tri) << "\n";
}
cmakefileStream
<< " )\n";
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index a4dad1e6d4..2ee23d18a4 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1118,8 +1118,8 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
pi != this->MultipleOutputPairs.end(); ++pi)
{
*this->InfoFileStream
- << " " << this->LocalGenerator->EscapeForCMake(pi->first)
- << " " << this->LocalGenerator->EscapeForCMake(pi->second)
+ << " " << cmLocalGenerator::EscapeForCMake(pi->first)
+ << " " << cmLocalGenerator::EscapeForCMake(pi->second)
<< "\n";
}
*this->InfoFileStream << " )\n\n";
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index add80fa688..7e11d8c843 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -82,7 +82,6 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
// be translated.
std::string exe = command[0];
cmMakefile* mf = this->Test->GetMakefile();
- cmLocalGenerator* lg = mf->GetLocalGenerator();
cmTarget* target = mf->FindTargetToUse(exe);
if(target && target->GetType() == cmTarget::EXECUTABLE)
{
@@ -98,13 +97,13 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
cmSystemTools::ExpandListArgument(emulator, emulatorWithArgs);
std::string emulatorExe(emulatorWithArgs[0]);
cmSystemTools::ConvertToUnixSlashes(emulatorExe);
- os << lg->EscapeForCMake(emulatorExe) << " ";
+ os << cmLocalGenerator::EscapeForCMake(emulatorExe) << " ";
for(std::vector<std::string>::const_iterator ei =
emulatorWithArgs.begin()+1;
ei != emulatorWithArgs.end();
++ei)
{
- os << lg->EscapeForCMake(*ei) << " ";
+ os << cmLocalGenerator::EscapeForCMake(*ei) << " ";
}
}
}
@@ -116,11 +115,12 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
}
// Generate the command line with full escapes.
- os << lg->EscapeForCMake(exe);
+ os << cmLocalGenerator::EscapeForCMake(exe);
for(std::vector<std::string>::const_iterator ci = command.begin()+1;
ci != command.end(); ++ci)
{
- os << " " << lg->EscapeForCMake(ge.Parse(*ci)->Evaluate(mf, config));
+ os << " " << cmLocalGenerator::EscapeForCMake(
+ ge.Parse(*ci)->Evaluate(mf, config));
}
// Finish the test command.
@@ -136,7 +136,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
i != pm.end(); ++i)
{
os << " " << i->first
- << " " << lg->EscapeForCMake(
+ << " " << cmLocalGenerator::EscapeForCMake(
ge.Parse(i->second.GetValue())->Evaluate(mf, config));
}
os << ")" << std::endl;
@@ -197,8 +197,6 @@ void cmTestGenerator::GenerateOldStyle(std::ostream& fout,
fout << ")" << std::endl;
// Output properties for the test.
- cmMakefile* mf = this->Test->GetMakefile();
- cmLocalGenerator* lg = mf->GetLocalGenerator();
cmPropertyMap& pm = this->Test->GetProperties();
if(!pm.empty())
{
@@ -208,7 +206,7 @@ void cmTestGenerator::GenerateOldStyle(std::ostream& fout,
i != pm.end(); ++i)
{
fout << " " << i->first
- << " " << lg->EscapeForCMake(i->second.GetValue());
+ << " " << cmLocalGenerator::EscapeForCMake(i->second.GetValue());
}
fout << ")" << std::endl;
}