cmMakefile: Remove File from IncludeScope.
Get it from the Makefile instead.
This commit is contained in:
parent
27f229b970
commit
b7166afa6d
@ -409,12 +409,11 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
|
|||||||
class cmMakefile::IncludeScope
|
class cmMakefile::IncludeScope
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
IncludeScope(cmMakefile* mf, const char* fname, bool noPolicyScope);
|
IncludeScope(cmMakefile* mf, bool noPolicyScope);
|
||||||
~IncludeScope();
|
~IncludeScope();
|
||||||
void Quiet() { this->ReportError = false; }
|
void Quiet() { this->ReportError = false; }
|
||||||
private:
|
private:
|
||||||
cmMakefile* Makefile;
|
cmMakefile* Makefile;
|
||||||
const char* File;
|
|
||||||
bool NoPolicyScope;
|
bool NoPolicyScope;
|
||||||
bool CheckCMP0011;
|
bool CheckCMP0011;
|
||||||
bool ReportError;
|
bool ReportError;
|
||||||
@ -422,9 +421,9 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
cmMakefile::IncludeScope::IncludeScope(cmMakefile* mf, const char* fname,
|
cmMakefile::IncludeScope::IncludeScope(cmMakefile* mf,
|
||||||
bool noPolicyScope):
|
bool noPolicyScope):
|
||||||
Makefile(mf), File(fname), NoPolicyScope(noPolicyScope),
|
Makefile(mf), NoPolicyScope(noPolicyScope),
|
||||||
CheckCMP0011(false), ReportError(true)
|
CheckCMP0011(false), ReportError(true)
|
||||||
{
|
{
|
||||||
if(!this->NoPolicyScope)
|
if(!this->NoPolicyScope)
|
||||||
@ -501,7 +500,8 @@ void cmMakefile::IncludeScope::EnforceCMP0011()
|
|||||||
{
|
{
|
||||||
std::ostringstream w;
|
std::ostringstream w;
|
||||||
w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0011) << "\n"
|
w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0011) << "\n"
|
||||||
<< "The included script\n " << this->File << "\n"
|
<< "The included script\n "
|
||||||
|
<< this->Makefile->ListFileStack.back() << "\n"
|
||||||
<< "affects policy settings. "
|
<< "affects policy settings. "
|
||||||
<< "CMake is implying the NO_POLICY_SCOPE option for compatibility, "
|
<< "CMake is implying the NO_POLICY_SCOPE option for compatibility, "
|
||||||
<< "so the effects are applied to the including context.";
|
<< "so the effects are applied to the including context.";
|
||||||
@ -513,7 +513,8 @@ void cmMakefile::IncludeScope::EnforceCMP0011()
|
|||||||
{
|
{
|
||||||
std::ostringstream e;
|
std::ostringstream e;
|
||||||
e << cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0011) << "\n"
|
e << cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0011) << "\n"
|
||||||
<< "The included script\n " << this->File << "\n"
|
<< "The included script\n "
|
||||||
|
<< this->Makefile->ListFileStack.back() << "\n"
|
||||||
<< "affects policy settings, so it requires this policy to be set.";
|
<< "affects policy settings, so it requires this policy to be set.";
|
||||||
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
|
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
|
||||||
}
|
}
|
||||||
@ -586,7 +587,7 @@ 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");
|
||||||
|
|
||||||
IncludeScope incScope(this, filenametoread.c_str(), noPolicyScope);
|
IncludeScope incScope(this, noPolicyScope);
|
||||||
this->ReadListFileInternal(listFile);
|
this->ReadListFileInternal(listFile);
|
||||||
if(cmSystemTools::GetFatalErrorOccured())
|
if(cmSystemTools::GetFatalErrorOccured())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user