diff --git a/Source/cmComputeComponentGraph.cxx b/Source/cmComputeComponentGraph.cxx index 81cd8785bf..6591fb1d32 100644 --- a/Source/cmComputeComponentGraph.cxx +++ b/Source/cmComputeComponentGraph.cxx @@ -7,6 +7,12 @@ cmComputeComponentGraph::cmComputeComponentGraph(Graph const& input) : InputGraph(input) +{ +} + +cmComputeComponentGraph::~cmComputeComponentGraph() = default; + +void cmComputeComponentGraph::Compute() { // Identify components. this->Tarjan(); @@ -17,8 +23,6 @@ cmComputeComponentGraph::cmComputeComponentGraph(Graph const& input) this->TransferEdges(); } -cmComputeComponentGraph::~cmComputeComponentGraph() = default; - void cmComputeComponentGraph::Tarjan() { int n = static_cast(this->InputGraph.size()); diff --git a/Source/cmComputeComponentGraph.h b/Source/cmComputeComponentGraph.h index 202888cf9c..b873131574 100644 --- a/Source/cmComputeComponentGraph.h +++ b/Source/cmComputeComponentGraph.h @@ -31,6 +31,9 @@ public: cmComputeComponentGraph(Graph const& input); ~cmComputeComponentGraph(); + /** Run the computation. */ + void Compute(); + /** Get the adjacency list of the component graph. */ Graph const& GetComponentGraph() const { return this->ComponentGraph; } EdgeList const& GetComponentGraphEdges(int c) const diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 607b948c71..8ca2168b50 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -626,6 +626,7 @@ void cmComputeLinkDepends::OrderLinkEntires() // constraints disallow it. this->CCG = cm::make_unique(this->EntryConstraintGraph); + this->CCG->Compute(); // The component graph is guaranteed to be acyclic. Start a DFS // from every entry to compute a topological order for the diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index 6b4d110f91..42c8a0432c 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -118,6 +118,7 @@ bool cmComputeTargetDepends::Compute() // Identify components. cmComputeComponentGraph ccg(this->InitialGraph); + ccg.Compute(); if (this->DebugMode) { this->DisplayComponents(ccg); }