| 62 | } |
| 63 | |
| 64 | void 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 | |
| 114 | cmGeneratorExpressionDAGChecker::Result |
| 115 | cmGeneratorExpressionDAGChecker::CheckGraph() const |
nothing calls this directly
no test coverage detected