cmMakefile: Move include scope out of ReadListFileInternal.

Simplify the ReadListFileInternal API.
This commit is contained in:
Stephen Kelly 2015-06-21 19:46:03 +02:00
parent 9166b49d70
commit 27f229b970
2 changed files with 8 additions and 9 deletions

View File

@ -586,7 +586,12 @@ bool cmMakefile::ReadListFile(const char* listfile,
this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE");
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->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str());
@ -600,12 +605,9 @@ bool cmMakefile::ReadListFile(const char* listfile,
return true;
}
void cmMakefile::ReadListFileInternal(cmListFile const& listFile,
const char* filenametoread,
bool noPolicyScope)
void cmMakefile::ReadListFileInternal(cmListFile const& listFile)
{
// Enforce balanced blocks (if/endif, function/endfunction, etc.).
IncludeScope incScope(this, filenametoread, noPolicyScope);
LexicalPushPop lexScope(this);
// Run the parsed commands.
@ -618,7 +620,6 @@ void cmMakefile::ReadListFileInternal(cmListFile const& listFile,
{
// Exit early due to error.
lexScope.Quiet();
incScope.Quiet();
break;
}
if(status.GetReturnInvoked())

View File

@ -918,9 +918,7 @@ private:
bool noPolicyScope,
bool requireProjectCommand);
void ReadListFileInternal(cmListFile const& listFile,
const char* filenametoread,
bool noPolicyScope);
void ReadListFileInternal(cmListFile const& listFile);
bool ParseDefineFlag(std::string const& definition, bool remove);