|
@@ -171,6 +171,9 @@ void cmMakefile::Initialize()
|
|
|
// Protect the directory-level policies.
|
|
|
this->PushPolicyBarrier();
|
|
|
|
|
|
+ // push empty loop block
|
|
|
+ this->PushLoopBlockBarrier();
|
|
|
+
|
|
|
// By default the check is not done. It is enabled by
|
|
|
// cmListFileCache in the top level if necessary.
|
|
|
this->CheckCMP0000 = false;
|
|
@@ -3353,6 +3356,38 @@ void cmMakefile::PopFunctionBlockerBarrier(bool reportError)
|
|
|
this->FunctionBlockerBarriers.pop_back();
|
|
|
}
|
|
|
|
|
|
+//----------------------------------------------------------------------------
|
|
|
+void cmMakefile::PushLoopBlock()
|
|
|
+{
|
|
|
+ assert(!this->LoopBlockCounter.empty());
|
|
|
+ this->LoopBlockCounter.top()++;
|
|
|
+}
|
|
|
+
|
|
|
+void cmMakefile::PopLoopBlock()
|
|
|
+{
|
|
|
+ assert(!this->LoopBlockCounter.empty());
|
|
|
+ assert(this->LoopBlockCounter.top() > 0);
|
|
|
+ this->LoopBlockCounter.top()--;
|
|
|
+}
|
|
|
+
|
|
|
+void cmMakefile::PushLoopBlockBarrier()
|
|
|
+{
|
|
|
+ this->LoopBlockCounter.push(0);
|
|
|
+}
|
|
|
+
|
|
|
+void cmMakefile::PopLoopBlockBarrier()
|
|
|
+{
|
|
|
+ assert(!this->LoopBlockCounter.empty());
|
|
|
+ assert(this->LoopBlockCounter.top() == 0);
|
|
|
+ this->LoopBlockCounter.pop();
|
|
|
+}
|
|
|
+
|
|
|
+bool cmMakefile::IsLoopBlock() const
|
|
|
+{
|
|
|
+ assert(!this->LoopBlockCounter.empty());
|
|
|
+ return !this->LoopBlockCounter.empty() && this->LoopBlockCounter.top() > 0;
|
|
|
+}
|
|
|
+
|
|
|
//----------------------------------------------------------------------------
|
|
|
bool cmMakefile::ExpandArguments(
|
|
|
std::vector<cmListFileArgument> const& inArgs,
|
|
@@ -4487,10 +4522,14 @@ void cmMakefile::PushScope()
|
|
|
this->Internal->VarStack.push(cmDefinitions(parent));
|
|
|
this->Internal->VarInitStack.push(init);
|
|
|
this->Internal->VarUsageStack.push(usage);
|
|
|
+
|
|
|
+ this->PushLoopBlockBarrier();
|
|
|
}
|
|
|
|
|
|
void cmMakefile::PopScope()
|
|
|
{
|
|
|
+ this->PopLoopBlockBarrier();
|
|
|
+
|
|
|
cmDefinitions* current = &this->Internal->VarStack.top();
|
|
|
std::set<std::string> init = this->Internal->VarInitStack.top();
|
|
|
std::set<std::string> usage = this->Internal->VarUsageStack.top();
|