diff options
author | Brad King <brad.king@kitware.com> | 2008-08-27 14:21:57 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-08-27 14:21:57 (GMT) |
commit | 816ee0f83cd9775e3b378fe3b074efe06d6b29a6 (patch) | |
tree | b32d2fdc46a9008f0da7b441d2fd2ea65f1cec91 /Source/cmComputeLinkDepends.h | |
parent | 012e4c4f68dc75002468cc043065c358bc12a7b5 (diff) | |
download | CMake-816ee0f83cd9775e3b378fe3b074efe06d6b29a6.zip CMake-816ee0f83cd9775e3b378fe3b074efe06d6b29a6.tar.gz CMake-816ee0f83cd9775e3b378fe3b074efe06d6b29a6.tar.bz2 |
ENH: New link line item ordering algorithm
This change introduces a new algorithm for link line construction. The
order it computes always begins with the exact link line specified by
the user. Dependencies of items specified by the user are tracked, and
those that are not already satisified by the line are appended to it at
the end with minimal repeats. This restores the behavior of CMake 2.4
and below while still fixing some of its bugs. See issue #7546.
Diffstat (limited to 'Source/cmComputeLinkDepends.h')
-rw-r--r-- | Source/cmComputeLinkDepends.h | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h index b41da9e..b738d8f 100644 --- a/Source/cmComputeLinkDepends.h +++ b/Source/cmComputeLinkDepends.h @@ -131,15 +131,33 @@ private: // Ordering algorithm. void OrderLinkEntires(); std::vector<char> ComponentVisited; + std::vector<int> ComponentOrder; + int ComponentOrderId; + struct PendingComponent + { + // The real component id. Needed because the map is indexed by + // component topological index. + int Id; + + // The number of times the component needs to be seen. This is + // always 1 for trivial components and is initially 2 for + // non-trivial components. + int Count; + + // The entries yet to be seen to complete the component. + DependSet Entries; + }; + std::map<int, PendingComponent> PendingComponents; + cmComputeComponentGraph* CCG; std::vector<int> FinalLinkOrder; - void DisplayComponents(cmComputeComponentGraph const& ccg); - void VisitComponent(cmComputeComponentGraph const& ccg, unsigned int i); - void EmitComponent(NodeList const& nl); + void DisplayComponents(); + void VisitComponent(unsigned int c); + void VisitEntry(int index); + PendingComponent& MakePendingComponent(unsigned int component); void DisplayFinalEntries(); - // Preservation of original link line. + // Record of the original link line. std::vector<int> OriginalEntries; - void PreserveOriginalEntries(); // Compatibility help. bool OldLinkDirMode; |