summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmIfCommand.cxx11
-rw-r--r--Source/cmMakefile.cxx20
-rw-r--r--Source/cmMakefile.h19
3 files changed, 28 insertions, 22 deletions
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index 508a263..cbba2d3 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -76,6 +76,10 @@ IsFunctionBlocked(const cmListFileFunction& lff,
}
else
{
+ // Place this call on the call stack.
+ cmMakefileCall stack_manager(&mf, this->Functions[c], status);
+ static_cast<void>(stack_manager);
+
std::string errorString;
std::vector<std::string> expandedArguments;
@@ -98,8 +102,10 @@ IsFunctionBlocked(const cmListFileFunction& lff,
err += "(";
err += errorString;
err += ").";
- cmSystemTools::Error(err.c_str());
- return false;
+ mf.IssueMessage(cmake::FATAL_ERROR, err);
+ cmSystemTools::SetFatalErrorOccured();
+ mf.RemoveFunctionBlocker(lff);
+ return true;
}
if (isTrue)
@@ -204,6 +210,7 @@ bool cmIfCommand
err += errorString;
err += ").";
this->SetError(err.c_str());
+ cmSystemTools::SetFatalErrorOccured();
return false;
}
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 92d5938..bc013f9 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -349,26 +349,6 @@ bool cmMakefile::GetBacktrace(cmListFileBacktrace& backtrace) const
}
//----------------------------------------------------------------------------
-// Helper class to make sure the call stack is valid.
-class cmMakefileCall
-{
-public:
- cmMakefileCall(cmMakefile* mf,
- cmListFileContext const& lfc,
- cmExecutionStatus& status): Makefile(mf)
- {
- cmMakefile::CallStackEntry entry = {&lfc, &status};
- this->Makefile->CallStack.push_back(entry);
- }
- ~cmMakefileCall()
- {
- this->Makefile->CallStack.pop_back();
- }
-private:
- cmMakefile* Makefile;
-};
-
-//----------------------------------------------------------------------------
bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
cmExecutionStatus &status)
{
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 77843e8..6a09042 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -921,5 +921,24 @@ private:
void EnforceDirectoryLevelRules();
};
+//----------------------------------------------------------------------------
+// Helper class to make sure the call stack is valid.
+class cmMakefileCall
+{
+public:
+ cmMakefileCall(cmMakefile* mf,
+ cmListFileContext const& lfc,
+ cmExecutionStatus& status): Makefile(mf)
+ {
+ cmMakefile::CallStackEntry entry = {&lfc, &status};
+ this->Makefile->CallStack.push_back(entry);
+ }
+ ~cmMakefileCall()
+ {
+ this->Makefile->CallStack.pop_back();
+ }
+private:
+ cmMakefile* Makefile;
+};
#endif