diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-08-26 17:35:45 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-08-26 17:35:45 (GMT) |
commit | d67584ccc4262c103a180504cb294e3ad6b6910d (patch) | |
tree | 456b7484187e71adad2cac1c08100cdf74821535 /Source | |
parent | 33df7f36d0b99a87880ee76d39b5814c98e78bd1 (diff) | |
download | CMake-d67584ccc4262c103a180504cb294e3ad6b6910d.zip CMake-d67584ccc4262c103a180504cb294e3ad6b6910d.tar.gz CMake-d67584ccc4262c103a180504cb294e3ad6b6910d.tar.bz2 |
cmTarget: Move link interface libraries struct out.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmComputeLinkDepends.cxx | 8 | ||||
-rw-r--r-- | Source/cmComputeLinkDepends.h | 2 | ||||
-rw-r--r-- | Source/cmComputeTargetDepends.cxx | 2 | ||||
-rw-r--r-- | Source/cmExportFileGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmGeneratorExpressionNode.cxx | 2 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 4 | ||||
-rw-r--r-- | Source/cmLinkItem.h | 40 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 36 | ||||
-rw-r--r-- | Source/cmTarget.h | 34 |
9 files changed, 65 insertions, 67 deletions
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 59590fd..03ec820 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -361,7 +361,7 @@ void cmComputeLinkDepends::FollowLinkEntry(BFSEntry const& qe) if(entry.Target) { // Follow the target dependencies. - if(cmTarget::LinkInterface const* iface = + if(cmLinkInterface const* iface = entry.Target->GetLinkInterface(this->Config, this->Target->Target)) { const bool isIface = @@ -396,7 +396,7 @@ void cmComputeLinkDepends::FollowLinkEntry(BFSEntry const& qe) //---------------------------------------------------------------------------- void cmComputeLinkDepends -::FollowSharedDeps(int depender_index, cmTarget::LinkInterface const* iface, +::FollowSharedDeps(int depender_index, cmLinkInterface const* iface, bool follow_interface) { // Follow dependencies if we have not followed them already. @@ -459,7 +459,7 @@ void cmComputeLinkDepends::HandleSharedDependency(SharedDepEntry const& dep) // Target items may have their own dependencies. if(entry.Target) { - if(cmTarget::LinkInterface const* iface = + if(cmLinkInterface const* iface = entry.Target->GetLinkInterface(this->Config, this->Target->Target)) { // Follow public and private dependencies transitively. @@ -930,7 +930,7 @@ int cmComputeLinkDepends::ComputeComponentCount(NodeList const& nl) { if(cmTarget const* target = this->EntryList[*ni].Target) { - if(cmTarget::LinkInterface const* iface = + if(cmLinkInterface const* iface = target->GetLinkInterface(this->Config, this->Target->Target)) { if(iface->Multiplicity > count) diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h index b925a4f..2cbb430 100644 --- a/Source/cmComputeLinkDepends.h +++ b/Source/cmComputeLinkDepends.h @@ -102,7 +102,7 @@ private: std::queue<SharedDepEntry> SharedDepQueue; std::set<int> SharedDepFollowed; void FollowSharedDeps(int depender_index, - cmTarget::LinkInterface const* iface, + cmLinkInterface const* iface, bool follow_interface = false); void QueueSharedDependencies(int depender_index, std::vector<cmLinkItem> const& deps); diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index c4a03a0..aeb9184 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -296,7 +296,7 @@ void cmComputeTargetDepends::AddInterfaceDepends(int depender_index, std::set<std::string> &emitted) { cmGeneratorTarget const* depender = this->Targets[depender_index]; - if(cmTarget::LinkInterface const* iface = + if(cmLinkInterface const* iface = dependee->Target->GetLinkInterface(config, depender->Target)) { diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index cae60b7..d559a07 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -796,7 +796,7 @@ cmExportFileGenerator std::vector<std::string>& missingTargets) { // Add the transitive link dependencies for this configuration. - cmTarget::LinkInterface const* iface = target->Target->GetLinkInterface( + cmLinkInterface const* iface = target->Target->GetLinkInterface( config, target->Target); if (!iface) @@ -909,7 +909,7 @@ cmExportFileGenerator } // Add the transitive link dependencies for this configuration. - if(cmTarget::LinkInterface const* iface = + if(cmLinkInterface const* iface = target->Target ->GetLinkInterface(config, target->Target)) { diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 03bc83a..9509c2b 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -1108,7 +1108,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode if(isInterfaceProperty) { - if(cmTarget::LinkInterfaceLibraries const* iface = + if(cmLinkInterfaceLibraries const* iface = target->GetLinkInterfaceLibraries(context->Config, headTarget, true)) { linkedTargetsContent = diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index dd58e7b..06a4c6a 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -1173,7 +1173,7 @@ public: return; } - cmTarget::LinkInterface const* iface = + cmLinkInterface const* iface = item.Target->GetLinkInterface(this->Config, this->HeadTarget); if(!iface) { return; } @@ -1511,7 +1511,7 @@ void processILibs(const std::string& config, if (item.Target && emitted.insert(item.Target).second) { tgts.push_back(item.Target); - if(cmTarget::LinkInterfaceLibraries const* iface = + if(cmLinkInterfaceLibraries const* iface = item.Target->GetLinkInterfaceLibraries(config, headTarget, true)) { for(std::vector<cmLinkItem>::const_iterator diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h index a5427de..eb585ab 100644 --- a/Source/cmLinkItem.h +++ b/Source/cmLinkItem.h @@ -56,4 +56,44 @@ struct cmLinkImplementationLibraries std::vector<cmLinkItem> WrongConfigLibraries; }; +struct cmLinkInterfaceLibraries +{ + // Libraries listed in the interface. + std::vector<cmLinkItem> Libraries; +}; + +struct cmLinkInterface: public cmLinkInterfaceLibraries +{ + // Languages whose runtime libraries must be linked. + std::vector<std::string> Languages; + + // Shared library dependencies needed for linking on some platforms. + std::vector<cmLinkItem> SharedDeps; + + // Number of repetitions of a strongly connected component of two + // or more static libraries. + int Multiplicity; + + // Libraries listed for other configurations. + // Needed only for OLD behavior of CMP0003. + std::vector<cmLinkItem> WrongConfigLibraries; + + bool ImplementationIsInterface; + + cmLinkInterface(): Multiplicity(0), ImplementationIsInterface(false) {} +}; + +struct cmOptionalLinkInterface: public cmLinkInterface +{ + cmOptionalLinkInterface(): + LibrariesDone(false), AllDone(false), + Exists(false), HadHeadSensitiveCondition(false), + ExplicitLibraries(0) {} + bool LibrariesDone; + bool AllDone; + bool Exists; + bool HadHeadSensitiveCondition; + const char* ExplicitLibraries; +}; + #endif diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 49b3239..974aff5 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -91,31 +91,18 @@ public: // The backtrace when the target was created. cmListFileBacktrace Backtrace; - // Cache link interface computation from each configuration. - struct OptionalLinkInterface: public cmTarget::LinkInterface - { - OptionalLinkInterface(): - LibrariesDone(false), AllDone(false), - Exists(false), HadHeadSensitiveCondition(false), - ExplicitLibraries(0) {} - bool LibrariesDone; - bool AllDone; - bool Exists; - bool HadHeadSensitiveCondition; - const char* ExplicitLibraries; - }; void ComputeLinkInterface(cmTarget const* thisTarget, const std::string& config, - OptionalLinkInterface& iface, + cmOptionalLinkInterface& iface, cmTarget const* head) const; void ComputeLinkInterfaceLibraries(cmTarget const* thisTarget, const std::string& config, - OptionalLinkInterface& iface, + cmOptionalLinkInterface &iface, cmTarget const* head, bool usage_requirements_only); struct HeadToLinkInterfaceMap: - public std::map<cmTarget const*, OptionalLinkInterface> {}; + public std::map<cmTarget const*, cmOptionalLinkInterface> {}; typedef std::map<std::string, HeadToLinkInterfaceMap> LinkInterfaceMapType; LinkInterfaceMapType LinkInterfaceMap; @@ -4133,8 +4120,7 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config, } //---------------------------------------------------------------------------- -cmTarget::LinkInterface const* cmTarget::GetLinkInterface( - const std::string& config, +cmLinkInterface const* cmTarget::GetLinkInterface(const std::string& config, cmTarget const* head) const { // Imported targets have their own link interface. @@ -4163,7 +4149,7 @@ cmTarget::LinkInterface const* cmTarget::GetLinkInterface( return &hm.begin()->second; } - cmTargetInternals::OptionalLinkInterface& iface = hm[head]; + cmOptionalLinkInterface& iface = hm[head]; if(!iface.LibrariesDone) { iface.LibrariesDone = true; @@ -4183,7 +4169,7 @@ cmTarget::LinkInterface const* cmTarget::GetLinkInterface( } //---------------------------------------------------------------------------- -cmTarget::LinkInterfaceLibraries const* +const cmLinkInterfaceLibraries * cmTarget::GetLinkInterfaceLibraries(const std::string& config, cmTarget const* head, bool usage_requirements_only) const @@ -4216,7 +4202,7 @@ cmTarget::GetLinkInterfaceLibraries(const std::string& config, return &hm.begin()->second; } - cmTargetInternals::OptionalLinkInterface& iface = hm[head]; + cmOptionalLinkInterface& iface = hm[head]; if(!iface.LibrariesDone) { iface.LibrariesDone = true; @@ -4228,7 +4214,7 @@ cmTarget::GetLinkInterfaceLibraries(const std::string& config, } //---------------------------------------------------------------------------- -cmTarget::LinkInterface const* +const cmLinkInterface * cmTarget::GetImportLinkInterface(const std::string& config, cmTarget const* headTarget, bool usage_requirements_only) const @@ -4252,7 +4238,7 @@ cmTarget::GetImportLinkInterface(const std::string& config, return &hm.begin()->second; } - cmTargetInternals::OptionalLinkInterface& iface = hm[headTarget]; + cmOptionalLinkInterface& iface = hm[headTarget]; if(!iface.AllDone) { iface.AllDone = true; @@ -4275,7 +4261,7 @@ void cmTargetInternals::ComputeLinkInterfaceLibraries( cmTarget const* thisTarget, const std::string& config, - OptionalLinkInterface& iface, + cmOptionalLinkInterface& iface, cmTarget const* headTarget, bool usage_requirements_only) { @@ -4423,7 +4409,7 @@ cmTargetInternals::ComputeLinkInterfaceLibraries( //---------------------------------------------------------------------------- void cmTargetInternals::ComputeLinkInterface(cmTarget const* thisTarget, const std::string& config, - OptionalLinkInterface& iface, + cmOptionalLinkInterface &iface, cmTarget const* headTarget) const { if(iface.ExplicitLibraries) diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 2007b40..8594e05 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -233,39 +233,11 @@ public: void GetObjectLibrariesCMP0026(std::vector<cmTarget*>& objlibs) const; - /** The link interface specifies transitive library dependencies and - other information needed by targets that link to this target. */ - struct LinkInterfaceLibraries - { - // Libraries listed in the interface. - std::vector<cmLinkItem> Libraries; - }; - struct LinkInterface: public LinkInterfaceLibraries - { - // Languages whose runtime libraries must be linked. - std::vector<std::string> Languages; - - // Shared library dependencies needed for linking on some platforms. - std::vector<cmLinkItem> SharedDeps; - - // Number of repetitions of a strongly connected component of two - // or more static libraries. - int Multiplicity; - - // Libraries listed for other configurations. - // Needed only for OLD behavior of CMP0003. - std::vector<cmLinkItem> WrongConfigLibraries; - - bool ImplementationIsInterface; - - LinkInterface(): Multiplicity(0), ImplementationIsInterface(false) {} - }; - /** Get the link interface for the given configuration. Returns 0 if the target cannot be linked. */ - LinkInterface const* GetLinkInterface(const std::string& config, + cmLinkInterface const* GetLinkInterface(const std::string& config, cmTarget const* headTarget) const; - LinkInterfaceLibraries const* + cmLinkInterfaceLibraries const* GetLinkInterfaceLibraries(const std::string& config, cmTarget const* headTarget, bool usage_requirements_only) const; @@ -592,7 +564,7 @@ private: ImportInfo& info) const; - LinkInterface const* + cmLinkInterface const* GetImportLinkInterface(const std::string& config, cmTarget const* head, bool usage_requirements_only) const; |