diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-06-21 20:53:16 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-06-30 21:14:18 (GMT) |
commit | 0818737c851dce18a6da442ee73029b0de22ad56 (patch) | |
tree | 93f56b87f219e2e43eb5bfb81abdfb6739433287 | |
parent | dd7e42758d4874c087bbbc6ae062f36455f6d49c (diff) | |
download | CMake-0818737c851dce18a6da442ee73029b0de22ad56.zip CMake-0818737c851dce18a6da442ee73029b0de22ad56.tar.gz CMake-0818737c851dce18a6da442ee73029b0de22ad56.tar.bz2 |
cmMakefile: Make listfile scopes responsible for logical checks.
Remove the LexicalPushPop.
-rw-r--r-- | Source/cmMakefile.cxx | 23 | ||||
-rw-r--r-- | Source/cmMakefile.h | 13 |
2 files changed, 6 insertions, 30 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 9948ac8..d6cf104 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -412,10 +412,12 @@ public: : Makefile(mf), ReportError(true) { this->Makefile->PushPolicyBarrier(); + this->Makefile->PushFunctionBlockerBarrier(); } ~BuildsystemFileScope() { + this->Makefile->PopFunctionBlockerBarrier(this->ReportError); this->Makefile->PopPolicyBarrier(this->ReportError); } @@ -502,11 +504,13 @@ cmMakefile::IncludeScope::IncludeScope(cmMakefile* mf, // The included file cannot pop our policy scope. this->Makefile->PushPolicyBarrier(); this->Makefile->ListFileStack.push_back(filenametoread); + this->Makefile->PushFunctionBlockerBarrier(); } //---------------------------------------------------------------------------- cmMakefile::IncludeScope::~IncludeScope() { + this->Makefile->PopFunctionBlockerBarrier(this->ReportError); // Enforce matching policy scopes inside the included file. this->Makefile->PopPolicyBarrier(this->ReportError); @@ -605,10 +609,12 @@ public: : Makefile(mf), ReportError(true) { this->Makefile->PushPolicyBarrier(); + this->Makefile->PushFunctionBlockerBarrier(); } ~ListFileScope() { + this->Makefile->PopFunctionBlockerBarrier(this->ReportError); this->Makefile->PopPolicyBarrier(this->ReportError); this->Makefile->ListFileStack.pop_back(); } @@ -645,8 +651,6 @@ bool cmMakefile::ReadListFile(const char* filename) void cmMakefile::ReadListFile(cmListFile const& listFile, std::string const& filenametoread) { - LexicalPushPop lexScope(this); - // add this list file to the list of dependencies this->ListFiles.push_back(filenametoread); @@ -671,8 +675,6 @@ void cmMakefile::ReadListFile(cmListFile const& listFile, this->ExecuteCommand(listFile.Functions[i],status); if(cmSystemTools::GetFatalErrorOccured()) { - // Exit early due to error. - lexScope.Quiet(); break; } if(status.GetReturnInvoked()) @@ -3521,19 +3523,6 @@ cmMakefile::RemoveFunctionBlocker(cmFunctionBlocker* fb, return cmsys::auto_ptr<cmFunctionBlocker>(); } -//---------------------------------------------------------------------------- -cmMakefile::LexicalPushPop::LexicalPushPop(cmMakefile* mf): - Makefile(mf), ReportError(true) -{ - this->Makefile->PushFunctionBlockerBarrier(); -} - -//---------------------------------------------------------------------------- -cmMakefile::LexicalPushPop::~LexicalPushPop() -{ - this->Makefile->PopFunctionBlockerBarrier(this->ReportError); -} - const char* cmMakefile::GetHomeDirectory() const { return this->GetCMakeInstance()->GetHomeDirectory(); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 64783e5..ebf33df 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -100,19 +100,6 @@ public: cmsys::auto_ptr<cmFunctionBlocker> RemoveFunctionBlocker(cmFunctionBlocker* fb, const cmListFileFunction& lff); - /** Push/pop a lexical (function blocker) barrier automatically. */ - class LexicalPushPop - { - public: - LexicalPushPop(cmMakefile* mf); - ~LexicalPushPop(); - void Quiet() { this->ReportError = false; } - private: - cmMakefile* Makefile; - bool ReportError; - }; - friend class LexicalPushPop; - /** * Try running cmake and building a file. This is used for dynalically * loaded commands, not as part of the usual build process. |