diff options
author | Brad King <brad.king@kitware.com> | 2009-07-10 17:53:28 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-07-10 17:53:28 (GMT) |
commit | 19792bf30e0499cc49ee518e42274ef02e91db9a (patch) | |
tree | 581f5dbf7e7a46d9ff914c4b47180a422e25964b /Source/cmTarget.h | |
parent | ea00bb990bd6e7c307808ceb226e88bf49e483c8 (diff) | |
download | CMake-19792bf30e0499cc49ee518e42274ef02e91db9a.zip CMake-19792bf30e0499cc49ee518e42274ef02e91db9a.tar.gz CMake-19792bf30e0499cc49ee518e42274ef02e91db9a.tar.bz2 |
ENH: Consider link dependencies for link language
This teaches cmTarget to account for the languages compiled into link
dependencies when determining the linker language for its target.
We list the languages compiled into a static archive in its link
interface. Any target linking to it knows that the runtime libraries
for the static archive's languages must be available at link time. For
now this affects only the linker language selection, but later it will
allow CMake to automatically list the language runtime libraries.
Diffstat (limited to 'Source/cmTarget.h')
-rw-r--r-- | Source/cmTarget.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 63e8516..015a3a6 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -240,6 +240,9 @@ public: other information needed by targets that link to this target. */ struct LinkInterface { + // Languages whose runtime libraries must be linked. + std::vector<std::string> Languages; + // Libraries listed in the interface. std::vector<std::string> Libraries; @@ -259,6 +262,9 @@ public: dependencies needed by the object files of the target. */ struct LinkImplementation { + // Languages whose runtime libraries must be linked. + std::vector<std::string> Languages; + // Libraries linked directly in this configuration. std::vector<std::string> Libraries; @@ -268,6 +274,18 @@ public: }; LinkImplementation const* GetLinkImplementation(const char* config); + /** Link information from the transitive closure of the link + implementation and the interfaces of its dependencies. */ + struct LinkClosure + { + // The preferred linker language. + std::string LinkerLanguage; + + // Languages whose runtime libraries must be linked. + std::vector<std::string> Languages; + }; + LinkClosure const* GetLinkClosure(const char* config); + /** Strip off leading and trailing whitespace from an item named in the link dependencies of this target. */ std::string CheckCMP0004(std::string const& item); @@ -535,6 +553,7 @@ private: void ComputeLinkImplementation(const char* config, LinkImplementation& impl); + void ComputeLinkClosure(const char* config, LinkClosure& lc); // The cmMakefile instance that owns this target. This should // always be set. |