MCPcopy Create free account
hub / github.com/Kitware/CMake / ReportError

Method ReportError

Source/cmGeneratorExpressionDAGChecker.cxx:64–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64void cmGeneratorExpressionDAGChecker::ReportError(cm::GenEx::Evaluation* eval,
65 std::string const& expr)
66{
67 if (this->CheckResult == DAG) {
68 return;
69 }
70
71 eval->HadError = true;
72 if (eval->Quiet) {
73 return;
74 }
75
76 cmGeneratorExpressionDAGChecker const* parent = this->Parent;
77
78 if (parent && !parent->Parent) {
79 std::ostringstream e;
80 e << "Error evaluating generator expression:\n"
81 << " " << expr << "\n"
82 << "Self reference on target \"" << eval->HeadTarget->GetName()
83 << "\".\n";
84 eval->Context.LG->GetCMakeInstance()->IssueMessage(
85 MessageType::FATAL_ERROR, e.str(), parent->Backtrace);
86 return;
87 }
88
89 {
90 std::ostringstream e;
91 /* clang-format off */
92 e << "Error evaluating generator expression:\n"
93 << " " << expr << "\n"
94 << "Dependency loop found.";
95 /* clang-format on */
96 eval->Context.LG->GetCMakeInstance()->IssueMessage(
97 MessageType::FATAL_ERROR, e.str(), eval->Backtrace);
98 }
99
100 int loopStep = 1;
101 while (parent) {
102 std::ostringstream e;
103 e << "Loop step " << loopStep << "\n"
104 << " "
105 << (parent->Content ? parent->Content->GetOriginalExpression() : expr)
106 << "\n";
107 eval->Context.LG->GetCMakeInstance()->IssueMessage(
108 MessageType::FATAL_ERROR, e.str(), parent->Backtrace);
109 parent = parent->Parent;
110 ++loopStep;
111 }
112}
113
114cmGeneratorExpressionDAGChecker::Result
115cmGeneratorExpressionDAGChecker::CheckGraph() const

Callers

nothing calls this directly

Calls 5

strMethod · 0.80
GetOriginalExpressionMethod · 0.80
GetNameMethod · 0.45
IssueMessageMethod · 0.45
GetCMakeInstanceMethod · 0.45

Tested by

no test coverage detected