diff options
author | Brad King <brad.king@kitware.com> | 2015-05-27 13:22:57 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-05-27 13:22:57 (GMT) |
commit | 95bab020b3eddde3931b43ca41364ec840e83eae (patch) | |
tree | 8f47295cdb321ca0efd884258e8e7e3f6c360dc0 | |
parent | af570e13fd1fb82652bf8f5eeaa202a584953847 (diff) | |
parent | f5b0a0fba458077e0531586f07ed2d01fb7f6259 (diff) | |
download | CMake-95bab020b3eddde3931b43ca41364ec840e83eae.zip CMake-95bab020b3eddde3931b43ca41364ec840e83eae.tar.gz CMake-95bab020b3eddde3931b43ca41364ec840e83eae.tar.bz2 |
Merge topic 'minor-cleanups'
f5b0a0fb cmMakefile: Don't pop the directory listfile off the stack.
e40fcb59 cmMakefile: Simplify convert condition.
4fdad392 cmake: Remove redundant forward declaration.
df9635f3 cmake: Remove redundant condition.
ad167479 foreach: Remove unused variables.
aaeec642 cmGlobalGenerator: De-virtualize methods with no overrides.
444bc349 Ninja: Remove some bogus comments.
-rw-r--r-- | Source/cmForEachCommand.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 6 | ||||
-rw-r--r-- | Source/cmLocalNinjaGenerator.h | 9 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 29 | ||||
-rw-r--r-- | Source/cmake.cxx | 5 | ||||
-rw-r--r-- | Source/cmake.h | 1 |
6 files changed, 14 insertions, 38 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<std::string>::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 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<cmLocalGenerator*> 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<cmGeneratorExpressionEvaluationFile*> EvaluationFiles; - virtual const char* GetPredefinedTargetsFolder(); + const char* GetPredefinedTargetsFolder(); virtual bool UseFolderProperty(); private: 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(); diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 3e8ae85..71a8b6d 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -260,20 +260,11 @@ 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(); - } - if(!this->CallStack.empty() - || !this->GetCMakeInstance()->GetIsInTryCompile()) + // 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, cmLocalGenerator::HOME); @@ -536,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, @@ -578,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(); 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<std::string>& 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; } 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. * |