diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-05-05 19:50:39 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-05-14 18:30:09 (GMT) |
commit | 9486769866661e3aa76dd588ca5a7466e2969dc3 (patch) | |
tree | 56cbe397c6a522aaf84990c5e8603cba81d5a37f /Source | |
parent | a3139d4b1512195485cde49d919a13cdaec62660 (diff) | |
download | CMake-9486769866661e3aa76dd588ca5a7466e2969dc3.zip CMake-9486769866661e3aa76dd588ca5a7466e2969dc3.tar.gz CMake-9486769866661e3aa76dd588ca5a7466e2969dc3.tar.bz2 |
Don't use a cmLocalGenerator instance to call static methods.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmCoreTryCompile.cxx | 8 | ||||
-rw-r--r-- | Source/cmIfCommand.cxx | 9 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 7 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmTestGenerator.cxx | 16 |
5 files changed, 21 insertions, 23 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 1109aca..dd276a8 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 6dea5c1..3551f83 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 bf6fb61..faeb9db 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 a4dad1e..2ee23d1 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 add80fa..7e11d8c 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; } |