From b661403177edb1d22b89cc4a0ea69a8f93ad2ad2 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 21 Jun 2015 22:56:15 +0200 Subject: [PATCH] cmMakefile: Add filename to ReadListFile auto scopes. --- Source/cmMakefile.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b21e44117..b9a66d3ff 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -408,9 +408,10 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff, class cmMakefile::BuildsystemFileScope { public: - BuildsystemFileScope(cmMakefile* mf) + BuildsystemFileScope(cmMakefile* mf, std::string const& filename) : Makefile(mf), ReportError(true) { + this->Makefile->ListFileStack.push_back(filename); this->Makefile->PushPolicyBarrier(); this->Makefile->PushFunctionBlockerBarrier(); } @@ -432,14 +433,13 @@ bool cmMakefile::ProcessBuildsystemFile(const char* filename) this->AddDefinition("CMAKE_PARENT_LIST_FILE", filename); std::string curSrc = this->GetCurrentSourceDirectory(); - this->ListFileStack.push_back(filename); + BuildsystemFileScope scope(this, filename); cmListFile listFile; if (!listFile.ParseFile(filename, curSrc == this->GetHomeDirectory(), this)) { return false; } - BuildsystemFileScope scope(this); this->ReadListFile(listFile, filename); if(cmSystemTools::GetFatalErrorOccured()) { @@ -604,9 +604,10 @@ bool cmMakefile::ReadDependentFile(const char* filename, bool noPolicyScope) class cmMakefile::ListFileScope { public: - ListFileScope(cmMakefile* mf) + ListFileScope(cmMakefile* mf, std::string const& filenametoread) : Makefile(mf), ReportError(true) { + this->Makefile->ListFileStack.push_back(filenametoread); this->Makefile->PushPolicyBarrier(); this->Makefile->PushFunctionBlockerBarrier(); } @@ -630,7 +631,7 @@ bool cmMakefile::ReadListFile(const char* filename) cmSystemTools::CollapseFullPath(filename, this->GetCurrentSourceDirectory()); - this->ListFileStack.push_back(filenametoread); + ListFileScope scope(this, filenametoread); cmListFile listFile; if (!listFile.ParseFile(filenametoread.c_str(), false, this)) @@ -638,7 +639,6 @@ bool cmMakefile::ReadListFile(const char* filename) return false; } - ListFileScope scope(this); this->ReadListFile(listFile, filenametoread); if(cmSystemTools::GetFatalErrorOccured()) {