cmLinkItem: Add cmLinkImplementation type.

This commit is contained in:
Stephen Kelly 2015-08-05 17:37:48 +02:00
parent a7f5d70dde
commit 3846ebcf2b
7 changed files with 15 additions and 14 deletions

View File

@ -554,7 +554,7 @@ void cmComputeLinkDepends::AddVarLinkEntries(int depender_index,
void cmComputeLinkDepends::AddDirectLinkEntries() void cmComputeLinkDepends::AddDirectLinkEntries()
{ {
// Add direct link dependencies in this configuration. // Add direct link dependencies in this configuration.
cmTarget::LinkImplementation const* impl = cmLinkImplementation const* impl =
this->Target->Target->GetLinkImplementation(this->Config); this->Target->Target->GetLinkImplementation(this->Config);
this->AddLinkEntries(-1, impl->Libraries); this->AddLinkEntries(-1, impl->Libraries);
for(std::vector<cmLinkItem>::const_iterator for(std::vector<cmLinkItem>::const_iterator

View File

@ -252,7 +252,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
} }
} }
cmTarget::LinkImplementation const* impl = cmLinkImplementation const* impl =
depender->Target->GetLinkImplementation(*it); depender->Target->GetLinkImplementation(*it);
// A target should not depend on itself. // A target should not depend on itself.

View File

@ -1335,7 +1335,7 @@ void cmGeneratorTarget::ComputeLinkClosure(const std::string& config,
{ {
// Get languages built in this target. // Get languages built in this target.
UNORDERED_SET<std::string> languages; UNORDERED_SET<std::string> languages;
cmTarget::LinkImplementation const* impl = cmLinkImplementation const* impl =
this->Target->GetLinkImplementation(config); this->Target->GetLinkImplementation(config);
assert(impl); assert(impl);
for(std::vector<std::string>::const_iterator li = impl->Languages.begin(); for(std::vector<std::string>::const_iterator li = impl->Languages.begin();
@ -4057,7 +4057,7 @@ void cmGeneratorTarget::ComputeLinkInterface(const std::string& config,
} }
if (this->GetType() != cmTarget::INTERFACE_LIBRARY) if (this->GetType() != cmTarget::INTERFACE_LIBRARY)
{ {
cmTarget::LinkImplementation const* impl = cmLinkImplementation const* impl =
this->Target->GetLinkImplementation(config); this->Target->GetLinkImplementation(config);
for(std::vector<cmLinkImplItem>::const_iterator for(std::vector<cmLinkImplItem>::const_iterator
li = impl->Libraries.begin(); li != impl->Libraries.end(); ++li) li = impl->Libraries.begin(); li != impl->Libraries.end(); ++li)
@ -4098,7 +4098,7 @@ void cmGeneratorTarget::ComputeLinkInterface(const std::string& config,
if(this->Target->LinkLanguagePropagatesToDependents()) if(this->Target->LinkLanguagePropagatesToDependents())
{ {
// Targets using this archive need its language runtime libraries. // Targets using this archive need its language runtime libraries.
if(cmTarget::LinkImplementation const* impl = if(cmLinkImplementation const* impl =
this->Target->GetLinkImplementation(config)) this->Target->GetLinkImplementation(config))
{ {
iface.Languages = impl->Languages; iface.Languages = impl->Languages;

View File

@ -1383,7 +1383,7 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmTarget& cmtarget)
if(llang.empty()) { return; } if(llang.empty()) { return; }
// If the language is compiled as a source trust Xcode to link with it. // If the language is compiled as a source trust Xcode to link with it.
cmTarget::LinkImplementation const* impl = cmLinkImplementation const* impl =
cmtarget.GetLinkImplementation("NOCONFIG"); cmtarget.GetLinkImplementation("NOCONFIG");
for(std::vector<std::string>::const_iterator li = impl->Languages.begin(); for(std::vector<std::string>::const_iterator li = impl->Languages.begin();
li != impl->Languages.end(); ++li) li != impl->Languages.end(); ++li)

View File

@ -101,4 +101,10 @@ struct cmHeadToLinkInterfaceMap:
{ {
}; };
struct cmLinkImplementation: public cmLinkImplementationLibraries
{
// Languages whose runtime libraries must be linked.
std::vector<std::string> Languages;
};
#endif #endif

View File

@ -96,7 +96,7 @@ public:
ImportInfoMapType ImportInfoMap; ImportInfoMapType ImportInfoMap;
// Cache link implementation computation from each configuration. // Cache link implementation computation from each configuration.
struct OptionalLinkImplementation: public cmTarget::LinkImplementation struct OptionalLinkImplementation: public cmLinkImplementation
{ {
OptionalLinkImplementation(): OptionalLinkImplementation():
LibrariesDone(false), LanguagesDone(false), LibrariesDone(false), LanguagesDone(false),
@ -3584,7 +3584,7 @@ void cmTargetInternals::AddInterfaceEntries(
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmTarget::LinkImplementation const* const cmLinkImplementation *
cmTarget::GetLinkImplementation(const std::string& config) const cmTarget::GetLinkImplementation(const std::string& config) const
{ {
// There is no link implementation for imported targets. // There is no link implementation for imported targets.

View File

@ -231,12 +231,7 @@ public:
void GetObjectLibrariesCMP0026(std::vector<cmTarget*>& objlibs) const; void GetObjectLibrariesCMP0026(std::vector<cmTarget*>& objlibs) const;
struct LinkImplementation: public cmLinkImplementationLibraries cmLinkImplementation const*
{
// Languages whose runtime libraries must be linked.
std::vector<std::string> Languages;
};
LinkImplementation const*
GetLinkImplementation(const std::string& config) const; GetLinkImplementation(const std::string& config) const;
cmLinkImplementationLibraries const* cmLinkImplementationLibraries const*