diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-06-21 17:51:46 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-06-21 18:10:50 (GMT) |
commit | 826b6e68184759cda496f0073a8f59b2155cfdaf (patch) | |
tree | 599d4b3f199ccdded00de702fe707514965aa84f /Source | |
parent | e53072d638c2cca3258ffccbec75bb5c70d34a3f (diff) | |
download | CMake-826b6e68184759cda496f0073a8f59b2155cfdaf.zip CMake-826b6e68184759cda496f0073a8f59b2155cfdaf.tar.gz CMake-826b6e68184759cda496f0073a8f59b2155cfdaf.tar.bz2 |
cmMakefile: Move IncludeScope to ReadDependentFile.
Add replacement simple push/pop in the other two callers of
ReadListFile.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmMakefile.cxx | 25 | ||||
-rw-r--r-- | Source/cmMakefile.h | 1 |
2 files changed, 15 insertions, 11 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 6fee95c..87d6e3c 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -532,8 +532,10 @@ bool cmMakefile::ProcessBuildsystemFile(const char* listfile) { this->AddDefinition("CMAKE_PARENT_LIST_FILE", listfile); std::string curSrc = this->GetCurrentSourceDirectory(); - bool result = this->ReadListFile(listfile, true, + this->PushPolicyBarrier(); + bool result = this->ReadListFile(listfile, curSrc == this->GetHomeDirectory()); + this->PopPolicyBarrier(!cmSystemTools::GetFatalErrorOccured()); this->EnforceDirectoryLevelRules(); return result; } @@ -542,24 +544,31 @@ bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope) { this->AddDefinition("CMAKE_PARENT_LIST_FILE", this->GetDefinition("CMAKE_CURRENT_LIST_FILE")); - bool result = this->ReadListFile(listfile, noPolicyScope, false); + bool result = false; + { + IncludeScope incScope(this, noPolicyScope); + result = this->ReadListFile(listfile, false); + if(cmSystemTools::GetFatalErrorOccured()) + { + incScope.Quiet(); + } + } this->ListFileStack.pop_back(); return result; } bool cmMakefile::ReadListFile(const char* listfile) { - bool result = this->ReadListFile(listfile, true, false); + this->PushPolicyBarrier(); + bool result = this->ReadListFile(listfile, false); + this->PopPolicyBarrier(!cmSystemTools::GetFatalErrorOccured()); this->ListFileStack.pop_back(); return result; } bool cmMakefile::ReadListFile(const char* listfile, - bool noPolicyScope, bool requireProjectCommand) { - IncludeScope incScope(this, noPolicyScope); - std::string filenametoread = cmSystemTools::CollapseFullPath(listfile, this->GetCurrentSourceDirectory()); @@ -590,10 +599,6 @@ bool cmMakefile::ReadListFile(const char* listfile, this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR"); this->ReadListFileInternal(listFile); - if(cmSystemTools::GetFatalErrorOccured()) - { - incScope.Quiet(); - } this->CheckForUnusedVariables(); this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str()); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 2db7c93..9896d5b 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -915,7 +915,6 @@ private: cmState::Snapshot StateSnapshot; bool ReadListFile(const char* listfile, - bool noPolicyScope, bool requireProjectCommand); void ReadListFileInternal(cmListFile const& listFile); |