| 656 | } |
| 657 | |
| 658 | bool cmComputeTargetDepends::IntraComponent(std::vector<size_t> const& cmap, |
| 659 | size_t c, size_t i, size_t* head, |
| 660 | std::set<size_t>& emitted, |
| 661 | std::set<size_t>& visited) |
| 662 | { |
| 663 | if (!visited.insert(i).second) { |
| 664 | // Cycle in utility depends! |
| 665 | return false; |
| 666 | } |
| 667 | if (emitted.insert(i).second) { |
| 668 | // Honor strong intra-component edges in the final order. |
| 669 | EdgeList const& el = this->InitialGraph[i]; |
| 670 | for (cmGraphEdge const& edge : el) { |
| 671 | size_t j = edge; |
| 672 | if (cmap[j] == c && edge.IsStrong()) { |
| 673 | this->FinalGraph[i].emplace_back(j, true, edge.IsCross(), |
| 674 | edge.GetBacktrace()); |
| 675 | if (!this->IntraComponent(cmap, c, j, head, emitted, visited)) { |
| 676 | return false; |
| 677 | } |
| 678 | } |
| 679 | } |
| 680 | |
| 681 | // Prepend to a linear linked-list of intra-component edges. |
| 682 | if (*head != cmComputeComponentGraph::INVALID_COMPONENT) { |
| 683 | this->FinalGraph[i].emplace_back(*head, false, false, |
| 684 | cmListFileBacktrace()); |
| 685 | } else { |
| 686 | this->ComponentTail[c] = i; |
| 687 | } |
| 688 | *head = i; |
| 689 | } |
| 690 | return true; |
| 691 | } |
| 692 | |
| 693 | bool cmComputeTargetDepends::ComputeFinalDepends( |
| 694 | cmComputeComponentGraph const& ccg) |
no test coverage detected