cmMakefile: Make the IncludeScope more responsible.
It is now responsible for all resource management when including a file.
This commit is contained in:
parent
c10ab01434
commit
5c83768628
@ -409,7 +409,8 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
|
|||||||
class cmMakefile::IncludeScope
|
class cmMakefile::IncludeScope
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
IncludeScope(cmMakefile* mf, bool noPolicyScope);
|
IncludeScope(cmMakefile* mf, std::string const& filenametoread,
|
||||||
|
bool noPolicyScope);
|
||||||
~IncludeScope();
|
~IncludeScope();
|
||||||
void Quiet() { this->ReportError = false; }
|
void Quiet() { this->ReportError = false; }
|
||||||
private:
|
private:
|
||||||
@ -422,6 +423,7 @@ private:
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
cmMakefile::IncludeScope::IncludeScope(cmMakefile* mf,
|
cmMakefile::IncludeScope::IncludeScope(cmMakefile* mf,
|
||||||
|
std::string const& filenametoread,
|
||||||
bool noPolicyScope):
|
bool noPolicyScope):
|
||||||
Makefile(mf), NoPolicyScope(noPolicyScope),
|
Makefile(mf), NoPolicyScope(noPolicyScope),
|
||||||
CheckCMP0011(false), ReportError(true)
|
CheckCMP0011(false), ReportError(true)
|
||||||
@ -457,6 +459,7 @@ cmMakefile::IncludeScope::IncludeScope(cmMakefile* mf,
|
|||||||
|
|
||||||
// The included file cannot pop our policy scope.
|
// The included file cannot pop our policy scope.
|
||||||
this->Makefile->PushPolicyBarrier();
|
this->Makefile->PushPolicyBarrier();
|
||||||
|
this->Makefile->ListFileStack.push_back(filenametoread);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
@ -561,8 +564,7 @@ bool cmMakefile::ReadDependentFile(const char* filename, bool noPolicyScope)
|
|||||||
cmSystemTools::CollapseFullPath(filename,
|
cmSystemTools::CollapseFullPath(filename,
|
||||||
this->GetCurrentSourceDirectory());
|
this->GetCurrentSourceDirectory());
|
||||||
|
|
||||||
IncludeScope incScope(this, noPolicyScope);
|
IncludeScope incScope(this, filenametoread, noPolicyScope);
|
||||||
this->ListFileStack.push_back(filenametoread);
|
|
||||||
|
|
||||||
cmListFile listFile;
|
cmListFile listFile;
|
||||||
if (!listFile.ParseFile(filenametoread.c_str(), false, this))
|
if (!listFile.ParseFile(filenametoread.c_str(), false, this))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user