Commit 27f229b9 authored by Stephen Kelly's avatar Stephen Kelly
Browse files

cmMakefile: Move include scope out of ReadListFileInternal.

Simplify the ReadListFileInternal API.
parent 9166b49d
...@@ -586,7 +586,12 @@ bool cmMakefile::ReadListFile(const char* listfile, ...@@ -586,7 +586,12 @@ bool cmMakefile::ReadListFile(const char* listfile,
this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE"); this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE");
this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR"); this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR");
this->ReadListFileInternal(listFile, filenametoread.c_str(), noPolicyScope); IncludeScope incScope(this, filenametoread.c_str(), noPolicyScope);
this->ReadListFileInternal(listFile);
if(cmSystemTools::GetFatalErrorOccured())
{
incScope.Quiet();
}
this->CheckForUnusedVariables(); this->CheckForUnusedVariables();
this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str()); this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str());
...@@ -600,12 +605,9 @@ bool cmMakefile::ReadListFile(const char* listfile, ...@@ -600,12 +605,9 @@ bool cmMakefile::ReadListFile(const char* listfile,
return true; return true;
} }
void cmMakefile::ReadListFileInternal(cmListFile const& listFile, void cmMakefile::ReadListFileInternal(cmListFile const& listFile)
const char* filenametoread,
bool noPolicyScope)
{ {
// Enforce balanced blocks (if/endif, function/endfunction, etc.). // Enforce balanced blocks (if/endif, function/endfunction, etc.).
IncludeScope incScope(this, filenametoread, noPolicyScope);
LexicalPushPop lexScope(this); LexicalPushPop lexScope(this);
// Run the parsed commands. // Run the parsed commands.
...@@ -618,7 +620,6 @@ void cmMakefile::ReadListFileInternal(cmListFile const& listFile, ...@@ -618,7 +620,6 @@ void cmMakefile::ReadListFileInternal(cmListFile const& listFile,
{ {
// Exit early due to error. // Exit early due to error.
lexScope.Quiet(); lexScope.Quiet();
incScope.Quiet();
break; break;
} }
if(status.GetReturnInvoked()) if(status.GetReturnInvoked())
......
...@@ -918,9 +918,7 @@ private: ...@@ -918,9 +918,7 @@ private:
bool noPolicyScope, bool noPolicyScope,
bool requireProjectCommand); bool requireProjectCommand);
void ReadListFileInternal(cmListFile const& listFile, void ReadListFileInternal(cmListFile const& listFile);
const char* filenametoread,
bool noPolicyScope);
bool ParseDefineFlag(std::string const& definition, bool remove); bool ParseDefineFlag(std::string const& definition, bool remove);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment