diff options
author | Brad King <brad.king@kitware.com> | 2009-07-07 13:45:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-07-07 13:45:29 (GMT) |
commit | 34f78ee552694e95e20a312869632da06cbd1569 (patch) | |
tree | bb988444096af8d03c12117b3493b3e69971f9b4 /Source/cmTarget.h | |
parent | a60846718048e33db01e7993ba7d6fa994e0c8b5 (diff) | |
download | CMake-34f78ee552694e95e20a312869632da06cbd1569.zip CMake-34f78ee552694e95e20a312869632da06cbd1569.tar.gz CMake-34f78ee552694e95e20a312869632da06cbd1569.tar.bz2 |
ENH: Simplify cmTarget link interface storage
This makes the LinkInterface struct a member of cmTarget, pimplizes the
config-to-interface map, and stores interface instances by value.
Diffstat (limited to 'Source/cmTarget.h')
-rw-r--r-- | Source/cmTarget.h | 53 |
1 files changed, 21 insertions, 32 deletions
diff --git a/Source/cmTarget.h b/Source/cmTarget.h index a3e2439..8a8b30e 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -39,28 +39,6 @@ struct cmTargetLinkInformationMap: ~cmTargetLinkInformationMap(); }; -struct cmTargetLinkInterface -{ - // Libraries listed in the interface. - std::vector<std::string> Libraries; - - // Shared library dependencies needed for linking on some platforms. - std::vector<std::string> SharedDeps; - - // Libraries listed for other configurations. - // Needed only for OLD behavior of CMP0003. - std::vector<std::string> WrongConfigLibraries; -}; - -struct cmTargetLinkInterfaceMap: - public std::map<cmStdString, cmTargetLinkInterface*> -{ - typedef std::map<cmStdString, cmTargetLinkInterface*> derived; - cmTargetLinkInterfaceMap() {} - cmTargetLinkInterfaceMap(cmTargetLinkInterfaceMap const& r); - ~cmTargetLinkInterfaceMap(); -}; - class cmTargetInternals; class cmTargetInternalPointer { @@ -258,11 +236,25 @@ public: bool IsImported() const {return this->IsImportedTarget;} - /** Get the library interface dependencies. This is the set of - libraries from which something that links to this target may - also receive symbols. Returns 0 if the user has not specified - such dependencies or for static libraries. */ - cmTargetLinkInterface const* GetLinkInterface(const char* config); + /** The link interface specifies the transitive librarty + dependencies and other information needed by targets that link + to this target. */ + struct LinkInterface + { + // Libraries listed in the interface. + std::vector<std::string> Libraries; + + // Shared library dependencies needed for linking on some platforms. + std::vector<std::string> SharedDeps; + + // Libraries listed for other configurations. + // Needed only for OLD behavior of CMP0003. + std::vector<std::string> WrongConfigLibraries; + }; + + /** Get the link interface for the given configuration. Returns 0 + if the target cannot be linked. */ + LinkInterface const* GetLinkInterface(const char* config); /** Strip off leading and trailing whitespace from an item named in the link dependencies of this target. */ @@ -533,7 +525,7 @@ private: std::string Location; std::string SOName; std::string ImportLibrary; - cmTargetLinkInterface LinkInterface; + cmTarget::LinkInterface LinkInterface; }; typedef std::map<cmStdString, ImportInfo> ImportInfoMapType; ImportInfoMapType ImportInfoMap; @@ -542,10 +534,7 @@ private: cmTargetLinkInformationMap LinkInformation; - // Link interface. - cmsys::auto_ptr<cmTargetLinkInterface> - ComputeLinkInterface(const char* config); - cmTargetLinkInterfaceMap LinkInterface; + bool ComputeLinkInterface(const char* config, LinkInterface& iface); // The cmMakefile instance that owns this target. This should // always be set. |