From 444bc349781205bbfe3de25c6190beb0a7f0d44c Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 23 May 2015 14:49:07 +0200 Subject: Ninja: Remove some bogus comments. The virtual methods are overrides not overloads, the constructor is no longer a default variant, the destructor and GetCMakeInstance comments add no value, only a typo. --- Source/cmLocalNinjaGenerator.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h index 3a6e030..08b10e6 100644 --- a/Source/cmLocalNinjaGenerator.h +++ b/Source/cmLocalNinjaGenerator.h @@ -31,28 +31,19 @@ class cmake; class cmLocalNinjaGenerator : public cmLocalGenerator { public: - /// Default constructor. cmLocalNinjaGenerator(cmGlobalGenerator* gg, cmLocalGenerator* parent); - /// Destructor. virtual ~cmLocalNinjaGenerator(); - /// Overloaded methods. @see cmLocalGenerator::Generate() virtual void Generate(); - /// Overloaded methods. @see cmLocalGenerator::Configure() virtual void Configure(); - /// Overloaded methods. @see cmLocalGenerator::GetTargetDirectory() virtual std::string GetTargetDirectory(cmTarget const& target) const; const cmGlobalNinjaGenerator* GetGlobalNinjaGenerator() const; cmGlobalNinjaGenerator* GetGlobalNinjaGenerator(); - /** - * Shortcut to get the cmake instance throw the global generator. - * @return an instance of the cmake object. - */ const cmake* GetCMakeInstance() const; cmake* GetCMakeInstance(); -- cgit v0.12 From aaeec642ca9dfaf301c9a4c38e4b513564c41a5f Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 23 May 2015 14:52:55 +0200 Subject: cmGlobalGenerator: De-virtualize methods with no overrides. --- Source/cmGlobalGenerator.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index f9ea449..56574b8 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -121,7 +121,7 @@ public: * Try running cmake and building a file. This is used for dynamically * loaded commands, not as part of the usual build process. */ - virtual int TryCompile(const std::string& srcdir, const std::string& bindir, + int TryCompile(const std::string& srcdir, const std::string& bindir, const std::string& projectName, const std::string& targetName, bool fast, std::string& output, cmMakefile* mf); @@ -371,7 +371,7 @@ protected: typedef std::vector GeneratorVector; // for a project collect all its targets by following depend // information, and also collect all the targets - virtual void GetTargetSets(TargetDependSet& projectTargets, + void GetTargetSets(TargetDependSet& projectTargets, TargetDependSet& originalTargets, cmLocalGenerator* root, GeneratorVector const&); bool IsRootOnlyTarget(cmTarget* target) const; @@ -446,7 +446,7 @@ protected: TargetMap ImportedTargets; std::vector EvaluationFiles; - virtual const char* GetPredefinedTargetsFolder(); + const char* GetPredefinedTargetsFolder(); virtual bool UseFolderProperty(); private: -- cgit v0.12 From ad167479270e55151df54603496f6ee6bd3b0e42 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 24 May 2015 11:07:53 +0200 Subject: foreach: Remove unused variables. --- Source/cmForEachCommand.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 8e3510d..0dcda4d 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -44,8 +44,6 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf, std::vector::const_iterator j = this->Args.begin(); ++j; - std::string tmps; - cmListFileArgument arg; for( ; j != this->Args.end(); ++j) { // set the variable to the loop value -- cgit v0.12 From df9635f386aeac10e23495b2124d7713324e5c29 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 24 May 2015 12:55:43 +0200 Subject: cmake: Remove redundant condition. --- Source/cmake.cxx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index b4565e7..1c9842e 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1620,11 +1620,6 @@ int cmake::Run(const std::vector& args, bool noconfigure) std::string message = "Build files have been written to: "; message += this->GetHomeOutputDirectory(); this->UpdateProgress(message.c_str(), -1); - if(ret) - { - return ret; - } - return ret; } -- cgit v0.12 From 4fdad392b6ad59827866b8115bd554397e81ddb5 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 24 May 2015 12:56:09 +0200 Subject: cmake: Remove redundant forward declaration. The appropriate include is already here. --- Source/cmake.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/cmake.h b/Source/cmake.h index 7f95fb6..c0a9b49 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -30,7 +30,6 @@ class cmDocumentationSection; class cmPolicies; class cmTarget; class cmGeneratedFileStream; -class cmState; /** \brief Represents a cmake invocation. * -- cgit v0.12 From e40fcb598de8144a2824c7f30c754d3948231602 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 25 May 2015 09:21:56 +0200 Subject: cmMakefile: Simplify convert condition. The CallStack is checked above. --- Source/cmMakefile.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 3e8ae85..81960eb 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -272,8 +272,7 @@ void cmMakefile::IssueMessage(cmake::MessageType t, // command. Add whatever context information we have. lfc.FilePath = this->ListFileStack.back(); } - if(!this->CallStack.empty() - || !this->GetCMakeInstance()->GetIsInTryCompile()) + if(!this->GetCMakeInstance()->GetIsInTryCompile()) { lfc.FilePath = this->LocalGenerator->Convert(lfc.FilePath, cmLocalGenerator::HOME); -- cgit v0.12 From f5b0a0fba458077e0531586f07ed2d01fb7f6259 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 23 May 2015 11:06:54 +0200 Subject: cmMakefile: Don't pop the directory listfile off the stack. Simplify the IssueMessage implementation. --- Source/cmMakefile.cxx | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 81960eb..71a8b6d 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -260,18 +260,10 @@ void cmMakefile::IssueMessage(cmake::MessageType t, else { cmListFileContext lfc; - if(this->ListFileStack.empty()) - { - // We are not processing the project. Add the directory-level context. - lfc.FilePath = this->GetCurrentSourceDirectory(); - lfc.FilePath += "/CMakeLists.txt"; - } - else - { - // We are processing the project but are not currently executing a - // command. Add whatever context information we have. - lfc.FilePath = this->ListFileStack.back(); - } + // We are not currently executing a command. Add whatever context + // information we have. + lfc.FilePath = this->ListFileStack.back(); + if(!this->GetCMakeInstance()->GetIsInTryCompile()) { lfc.FilePath = this->LocalGenerator->Convert(lfc.FilePath, @@ -535,12 +527,16 @@ bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope) { this->AddDefinition("CMAKE_PARENT_LIST_FILE", this->GetDefinition("CMAKE_CURRENT_LIST_FILE")); - return this->ReadListFile(listfile, noPolicyScope, false); + bool result = this->ReadListFile(listfile, noPolicyScope, false); + this->ListFileStack.pop_back(); + return result; } bool cmMakefile::ReadListFile(const char* listfile) { - return this->ReadListFile(listfile, true, false); + bool result = this->ReadListFile(listfile, true, false); + this->ListFileStack.pop_back(); + return result; } bool cmMakefile::ReadListFile(const char* listfile, @@ -577,8 +573,6 @@ bool cmMakefile::ReadListFile(const char* listfile, this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE"); this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR"); - this->ListFileStack.pop_back(); - if (res) { this->CheckForUnusedVariables(); -- cgit v0.12