From ad70681909c75d266e297725eadd9f47e9bf001f Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 19 May 2015 09:47:18 +0200 Subject: [PATCH 1/5] cmLocalGenerator: Devirtualize method. --- Source/cmLocalGenerator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 67ac4fdd7..14fa28e1c 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -395,7 +395,7 @@ public: protected: ///! put all the libraries for a target on into the given stream - virtual void OutputLinkLibraries(std::string& linkLibraries, + void OutputLinkLibraries(std::string& linkLibraries, std::string& frameworkPath, std::string& linkPath, cmGeneratorTarget &, From 4080ca497e9841c73324e8cd4d1017a87065e879 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 19 May 2015 23:09:46 +0200 Subject: [PATCH 2/5] cmLocalGenerator: Inline ReadListFile method. --- Source/cmLocalGenerator.cxx | 16 ++++------------ Source/cmLocalGenerator.h | 3 --- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 118d5a312..9db82da7a 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -115,8 +115,10 @@ void cmLocalGenerator::Configure() filesDir += cmake::GetCMakeFilesDirectory(); cmSystemTools::MakeDirectory(filesDir.c_str()); - // find & read the list file - this->ReadInputFile(); + std::string currentStart = this->StateSnapshot.GetCurrentSourceDirectory(); + currentStart += "/CMakeLists.txt"; + assert(cmSystemTools::FileExists(currentStart.c_str(), true)); + this->Makefile->ProcessBuildsystemFile(currentStart.c_str()); // at the end of the ReadListFile handle any old style subdirs // first get all the subdirectories @@ -183,16 +185,6 @@ void cmLocalGenerator::ComputeObjectMaxPath() this->ObjectMaxPathViolations.clear(); } -//---------------------------------------------------------------------------- -void cmLocalGenerator::ReadInputFile() -{ - // Look for the CMakeLists.txt file. - std::string currentStart = this->StateSnapshot.GetCurrentSourceDirectory(); - currentStart += "/CMakeLists.txt"; - assert(cmSystemTools::FileExists(currentStart.c_str(), true)); - this->Makefile->ProcessBuildsystemFile(currentStart.c_str()); -} - void cmLocalGenerator::ConfigureFinalPass() { this->Makefile->ConfigureFinalPass(); diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 14fa28e1c..3fca22575 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -447,9 +447,6 @@ protected: definition. Issues a warning. */ virtual bool CheckDefinition(std::string const& define) const; - /** Read the input CMakeLists.txt file. */ - void ReadInputFile(); - cmMakefile *Makefile; cmState::Snapshot StateSnapshot; cmGlobalGenerator *GlobalGenerator; From 7601a7b12d1c4a3bddb1ca34dcf38e1aea188698 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 19 May 2015 23:10:30 +0200 Subject: [PATCH 3/5] cmLocalGenerator: Implement IsRootMakefile in terms of cmState. --- Source/cmLocalGenerator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 9db82da7a..aab6962db 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -76,7 +76,7 @@ cmLocalGenerator::~cmLocalGenerator() bool cmLocalGenerator::IsRootMakefile() const { - return !this->GetParent(); + return !this->StateSnapshot.GetParent().IsValid(); } //---------------------------------------------------------------------------- From 20c2fe4d10ac72b8352bdbea361124296a515d6c Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 19 May 2015 23:14:18 +0200 Subject: [PATCH 4/5] cmLocalGenerator: Get enabled languages from cmState. --- Source/cmLocalGenerator.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index aab6962db..0c568387f 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -995,8 +995,8 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable, { return this->Convert(cmSystemTools::GetCMakeCommand(), FULL, SHELL); } - std::vector enabledLanguages; - this->GlobalGenerator->GetEnabledLanguages(enabledLanguages); + std::vector enabledLanguages = + this->GetState()->GetEnabledLanguages(); // loop over language specific replace variables int pos = 0; while(ruleReplaceVars[pos]) From e54d2fdf50d7e1170f9e3dcbcb62ebacc7205de6 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 18 May 2015 04:54:27 +0200 Subject: [PATCH 5/5] Convert: Remove specification of default parameter. --- Source/cmLocalGenerator.cxx | 4 ++-- Source/cmMakefileLibraryTargetGenerator.cxx | 2 +- Source/cmNinjaNormalTargetGenerator.cxx | 3 +-- Source/cmake.cxx | 3 +-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 0c568387f..c2e996c22 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1838,7 +1838,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries, fdi != fwDirs.end(); ++fdi) { frameworkPath += fwSearchFlag; - frameworkPath += this->Convert(*fdi, NONE, shellFormat, false); + frameworkPath += this->Convert(*fdi, NONE, shellFormat); frameworkPath += " "; } } @@ -1892,7 +1892,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries, ri != runtimeDirs.end(); ++ri) { rpath += cli.GetRuntimeFlag(); - rpath += this->Convert(*ri, NONE, shellFormat, false); + rpath += this->Convert(*ri, NONE, shellFormat); rpath += " "; } fout << rpath; diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index c001622d8..450f57351 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -626,7 +626,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules install_name_dir = this->LocalGenerator->Convert(install_name_dir, cmLocalGenerator::NONE, - cmLocalGenerator::SHELL, false); + cmLocalGenerator::SHELL); vars.TargetInstallNameDir = install_name_dir.c_str(); } } diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 940701116..bbf03ffe4 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -525,8 +525,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() { vars["INSTALLNAME_DIR"] = localGen.Convert(install_dir, cmLocalGenerator::NONE, - cmLocalGenerator::SHELL, - false); + cmLocalGenerator::SHELL); } } } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index b2c603f03..ebec9236c 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -456,8 +456,7 @@ bool cmake::FindPackage(const std::vector& args) std::vector includeDirs; cmSystemTools::ExpandListArgument(includes, includeDirs); - std::string includeFlags = lg->GetIncludeFlags(includeDirs, 0, - language, false); + std::string includeFlags = lg->GetIncludeFlags(includeDirs, 0, language); std::string definitions = mf->GetSafeDefinition("PACKAGE_DEFINITIONS"); printf("%s %s\n", includeFlags.c_str(), definitions.c_str());