summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-07-05 17:28:45 (GMT)
committerBrad King <brad.king@kitware.com>2015-07-06 15:22:41 (GMT)
commit821f91d6ab668bbfcfc645a872acf91f71f76ff1 (patch)
tree8cb984d07e1f61a365e745c475de91a33e722192 /Source/cmMakefile.cxx
parent30d44efaf86194271c70f90a8fafa94a7d56f92c (diff)
downloadCMake-821f91d6ab668bbfcfc645a872acf91f71f76ff1.zip
CMake-821f91d6ab668bbfcfc645a872acf91f71f76ff1.tar.gz
CMake-821f91d6ab668bbfcfc645a872acf91f71f76ff1.tar.bz2
cmMakefile: Create a scoped context for parsing listfiles.
Update the Syntax tests to check for updated/improved backtraces.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx30
1 files changed, 30 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 08df655..0d48cbc 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -547,6 +547,26 @@ void cmMakefile::IncludeScope::EnforceCMP0011()
}
}
+class cmParseFileScope
+{
+public:
+ cmParseFileScope(cmMakefile* mf)
+ : Makefile(mf)
+ {
+ this->Context.FilePath = this->Makefile->GetExecutionFilePath();
+ this->Makefile->ContextStack.push_back(&this->Context);
+ }
+
+ ~cmParseFileScope()
+ {
+ this->Makefile->ContextStack.pop_back();
+ }
+
+private:
+ cmMakefile* Makefile;
+ cmListFileContext Context;
+};
+
bool cmMakefile::ReadDependentFile(const char* filename, bool noPolicyScope)
{
this->AddDefinition("CMAKE_PARENT_LIST_FILE",
@@ -558,10 +578,14 @@ bool cmMakefile::ReadDependentFile(const char* filename, bool noPolicyScope)
IncludeScope incScope(this, filenametoread, noPolicyScope);
cmListFile listFile;
+ {
+ cmParseFileScope pfs(this);
if (!listFile.ParseFile(filenametoread.c_str(), false, this))
{
return false;
}
+ }
+
this->ReadListFile(listFile, filenametoread);
if(cmSystemTools::GetFatalErrorOccured())
{
@@ -619,10 +643,13 @@ bool cmMakefile::ReadListFile(const char* filename)
ListFileScope scope(this, filenametoread);
cmListFile listFile;
+ {
+ cmParseFileScope pfs(this);
if (!listFile.ParseFile(filenametoread.c_str(), false, this))
{
return false;
}
+ }
this->ReadListFile(listFile, filenametoread);
if(cmSystemTools::GetFatalErrorOccured())
@@ -1738,11 +1765,14 @@ void cmMakefile::Configure()
this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentStart.c_str());
cmListFile listFile;
+ {
+ cmParseFileScope pfs(this);
if (!listFile.ParseFile(currentStart.c_str(), this->IsRootMakefile(), this))
{
this->SetConfigured();
return;
}
+ }
this->ReadListFile(listFile, currentStart);
if(cmSystemTools::GetFatalErrorOccured())
{