diff options
author | Brad King <brad.king@kitware.com> | 2008-01-31 20:45:31 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-01-31 20:45:31 (GMT) |
commit | 2cff26fa52cf9043f00d1efaaf31ab93e2db22e8 (patch) | |
tree | 4d403a91a70594893fc6b303a9cf693d4e538a9d /Source/cmComputeLinkDepends.h | |
parent | 52e75800b4731692f1e311f0d8701875ac98c96d (diff) | |
download | CMake-2cff26fa52cf9043f00d1efaaf31ab93e2db22e8.zip CMake-2cff26fa52cf9043f00d1efaaf31ab93e2db22e8.tar.gz CMake-2cff26fa52cf9043f00d1efaaf31ab93e2db22e8.tar.bz2 |
ENH: Support linking to shared libs with dependent libs
- Split IMPORTED_LINK_LIBRARIES into two parts:
IMPORTED_LINK_INTERFACE_LIBRARIES
IMPORTED_LINK_DEPENDENT_LIBRARIES
- Add CMAKE_DEPENDENT_SHARED_LIBRARY_MODE to select behavior
- Set mode to LINK for Darwin (fixes universal binary problem)
- Update ExportImport test to account for changes
Diffstat (limited to 'Source/cmComputeLinkDepends.h')
-rw-r--r-- | Source/cmComputeLinkDepends.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h index 881d50f..1e422a6 100644 --- a/Source/cmComputeLinkDepends.h +++ b/Source/cmComputeLinkDepends.h @@ -41,8 +41,10 @@ public: { std::string Item; cmTarget* Target; - LinkEntry(): Item(), Target(0) {} - LinkEntry(LinkEntry const& r): Item(r.Item), Target(r.Target) {} + bool IsSharedDep; + LinkEntry(): Item(), Target(0), IsSharedDep(false) {} + LinkEntry(LinkEntry const& r): + Item(r.Item), Target(r.Target), IsSharedDep(r.IsSharedDep) {} }; typedef std::vector<LinkEntry> EntryVector; @@ -65,8 +67,9 @@ private: typedef cmTarget::LinkLibraryVectorType LinkLibraryVectorType; + std::map<cmStdString, int>::iterator + AllocateLinkEntry(std::string const& item); int AddLinkEntry(std::string const& item); - void AddImportedLinkEntries(int depender_index, cmTarget* target); void AddVarLinkEntries(int depender_index, const char* value); void AddTargetLinkEntries(int depender_index, LinkLibraryVectorType const& libs); @@ -86,6 +89,19 @@ private: std::queue<BFSEntry> BFSQueue; void FollowLinkEntry(BFSEntry const&); + // Shared libraries that are included only because they are + // dependencies of other shared libraries, not because they are part + // of the interface. + struct SharedDepEntry + { + std::string Item; + int DependerIndex; + }; + std::queue<SharedDepEntry> SharedDepQueue; + void QueueSharedDependencies(int depender_index, + std::vector<std::string> const& deps); + void HandleSharedDependency(SharedDepEntry const& dep); + // Dependency inferral for each link item. struct DependSet: public std::set<int> {}; struct DependSetList: public std::vector<DependSet> {}; |