123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- #ifndef cmComputeLinkDepends_h
- #define cmComputeLinkDepends_h
- #include "cmConfigure.h"
- #include "cmGraphAdjacencyList.h"
- #include "cmLinkItem.h"
- #include "cmTargetLinkLibraryType.h"
- #include <map>
- #include <queue>
- #include <set>
- #include <string>
- #include <vector>
- class cmComputeComponentGraph;
- class cmGeneratorTarget;
- class cmGlobalGenerator;
- class cmMakefile;
- class cmake;
- class cmComputeLinkDepends
- {
- public:
- cmComputeLinkDepends(cmGeneratorTarget const* target,
- const std::string& config);
- ~cmComputeLinkDepends();
-
- struct LinkEntry
- {
- std::string Item;
- cmGeneratorTarget const* Target;
- bool IsSharedDep;
- bool IsFlag;
- LinkEntry()
- : Item()
- , Target(nullptr)
- , IsSharedDep(false)
- , IsFlag(false)
- {
- }
- LinkEntry(LinkEntry const& r)
- : Item(r.Item)
- , Target(r.Target)
- , IsSharedDep(r.IsSharedDep)
- , IsFlag(r.IsFlag)
- {
- }
- };
- typedef std::vector<LinkEntry> EntryVector;
- EntryVector const& Compute();
- void SetOldLinkDirMode(bool b);
- std::set<cmGeneratorTarget const*> const& GetOldWrongConfigItems() const
- {
- return this->OldWrongConfigItems;
- }
- private:
-
- cmGeneratorTarget const* Target;
- cmMakefile* Makefile;
- cmGlobalGenerator const* GlobalGenerator;
- cmake* CMakeInstance;
- std::string Config;
- EntryVector FinalLinkEntries;
- std::map<std::string, int>::iterator AllocateLinkEntry(
- std::string const& item);
- int AddLinkEntry(cmLinkItem const& item);
- void AddVarLinkEntries(int depender_index, const char* value);
- void AddDirectLinkEntries();
- template <typename T>
- void AddLinkEntries(int depender_index, std::vector<T> const& libs);
- cmGeneratorTarget const* FindTargetToLink(int depender_index,
- const std::string& name);
-
- std::vector<LinkEntry> EntryList;
- std::map<std::string, int> LinkEntryIndex;
-
- struct BFSEntry
- {
- int Index;
- const char* LibDepends;
- };
- std::queue<BFSEntry> BFSQueue;
- void FollowLinkEntry(BFSEntry qe);
-
-
-
- struct SharedDepEntry
- {
- cmLinkItem Item;
- int DependerIndex;
- };
- std::queue<SharedDepEntry> SharedDepQueue;
- std::set<int> SharedDepFollowed;
- void FollowSharedDeps(int depender_index, cmLinkInterface const* iface,
- bool follow_interface = false);
- void QueueSharedDependencies(int depender_index,
- std::vector<cmLinkItem> const& deps);
- void HandleSharedDependency(SharedDepEntry const& dep);
-
- struct DependSet : public std::set<int>
- {
- };
- struct DependSetList : public std::vector<DependSet>
- {
- };
- std::vector<DependSetList*> InferredDependSets;
- void InferDependencies();
-
- typedef cmGraphNodeList NodeList;
- typedef cmGraphEdgeList EdgeList;
- typedef cmGraphAdjacencyList Graph;
- Graph EntryConstraintGraph;
- void CleanConstraintGraph();
- void DisplayConstraintGraph();
-
- void OrderLinkEntires();
- std::vector<char> ComponentVisited;
- std::vector<int> ComponentOrder;
- struct PendingComponent
- {
-
-
- int Id;
-
-
-
- int Count;
-
- std::set<int> Entries;
- };
- std::map<int, PendingComponent> PendingComponents;
- cmComputeComponentGraph* CCG;
- std::vector<int> FinalLinkOrder;
- void DisplayComponents();
- void VisitComponent(unsigned int c);
- void VisitEntry(int index);
- PendingComponent& MakePendingComponent(unsigned int component);
- int ComputeComponentCount(NodeList const& nl);
- void DisplayFinalEntries();
-
- std::vector<int> OriginalEntries;
- std::set<cmGeneratorTarget const*> OldWrongConfigItems;
- void CheckWrongConfigItem(cmLinkItem const& item);
- int ComponentOrderId;
- cmTargetLinkLibraryType LinkType;
- bool HasConfig;
- bool DebugMode;
- bool OldLinkDirMode;
- };
- #endif
|