cmGeneratorTarget: Move GetLinkImplementation from cmTarget.
This commit is contained in:
parent
83981cf593
commit
d4a24c0e95
|
@ -555,7 +555,7 @@ void cmComputeLinkDepends::AddDirectLinkEntries()
|
||||||
{
|
{
|
||||||
// Add direct link dependencies in this configuration.
|
// Add direct link dependencies in this configuration.
|
||||||
cmLinkImplementation const* impl =
|
cmLinkImplementation const* impl =
|
||||||
this->Target->Target->GetLinkImplementation(this->Config);
|
this->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
|
||||||
wi = impl->WrongConfigLibraries.begin();
|
wi = impl->WrongConfigLibraries.begin();
|
||||||
|
|
|
@ -252,8 +252,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cmLinkImplementation const* impl =
|
cmLinkImplementation const* impl = depender->GetLinkImplementation(*it);
|
||||||
depender->Target->GetLinkImplementation(*it);
|
|
||||||
|
|
||||||
// A target should not depend on itself.
|
// A target should not depend on itself.
|
||||||
emitted.insert(depender->GetName());
|
emitted.insert(depender->GetName());
|
||||||
|
|
|
@ -1336,7 +1336,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;
|
||||||
cmLinkImplementation const* impl =
|
cmLinkImplementation const* impl =
|
||||||
this->Target->GetLinkImplementation(config);
|
this->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();
|
||||||
li != impl->Languages.end(); ++li)
|
li != impl->Languages.end(); ++li)
|
||||||
|
@ -4058,7 +4058,7 @@ void cmGeneratorTarget::ComputeLinkInterface(const std::string& config,
|
||||||
if (this->GetType() != cmTarget::INTERFACE_LIBRARY)
|
if (this->GetType() != cmTarget::INTERFACE_LIBRARY)
|
||||||
{
|
{
|
||||||
cmLinkImplementation const* impl =
|
cmLinkImplementation const* impl =
|
||||||
this->Target->GetLinkImplementation(config);
|
this->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)
|
||||||
{
|
{
|
||||||
|
@ -4099,7 +4099,7 @@ void cmGeneratorTarget::ComputeLinkInterface(const std::string& config,
|
||||||
{
|
{
|
||||||
// Targets using this archive need its language runtime libraries.
|
// Targets using this archive need its language runtime libraries.
|
||||||
if(cmLinkImplementation const* impl =
|
if(cmLinkImplementation const* impl =
|
||||||
this->Target->GetLinkImplementation(config))
|
this->GetLinkImplementation(config))
|
||||||
{
|
{
|
||||||
iface.Languages = impl->Languages;
|
iface.Languages = impl->Languages;
|
||||||
}
|
}
|
||||||
|
@ -4389,3 +4389,28 @@ cmGeneratorTarget::GetHeadToLinkInterfaceUsageRequirementsMap(
|
||||||
std::string CONFIG = cmSystemTools::UpperCase(config);
|
std::string CONFIG = cmSystemTools::UpperCase(config);
|
||||||
return this->LinkInterfaceUsageRequirementsOnlyMap[CONFIG];
|
return this->LinkInterfaceUsageRequirementsOnlyMap[CONFIG];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
const cmLinkImplementation *
|
||||||
|
cmGeneratorTarget::GetLinkImplementation(const std::string& config) const
|
||||||
|
{
|
||||||
|
// There is no link implementation for imported targets.
|
||||||
|
if(this->Target->IsImported())
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
cmOptionalLinkImplementation& impl = this->Target->GetLinkImplMap(config);
|
||||||
|
if(!impl.LibrariesDone)
|
||||||
|
{
|
||||||
|
impl.LibrariesDone = true;
|
||||||
|
this->Target->ComputeLinkImplementationLibraries(config, impl,
|
||||||
|
this->Target);
|
||||||
|
}
|
||||||
|
if(!impl.LanguagesDone)
|
||||||
|
{
|
||||||
|
impl.LanguagesDone = true;
|
||||||
|
this->Target->ComputeLinkImplementationLanguages(config, impl);
|
||||||
|
}
|
||||||
|
return &impl;
|
||||||
|
}
|
||||||
|
|
|
@ -198,6 +198,9 @@ public:
|
||||||
LinkClosure const* GetLinkClosure(const std::string& config) const;
|
LinkClosure const* GetLinkClosure(const std::string& config) const;
|
||||||
void ComputeLinkClosure(const std::string& config, LinkClosure& lc) const;
|
void ComputeLinkClosure(const std::string& config, LinkClosure& lc) const;
|
||||||
|
|
||||||
|
cmLinkImplementation const*
|
||||||
|
GetLinkImplementation(const std::string& config) const;
|
||||||
|
|
||||||
/** Full path with trailing slash to the top-level directory
|
/** Full path with trailing slash to the top-level directory
|
||||||
holding object files for this target. Includes the build
|
holding object files for this target. Includes the build
|
||||||
time config name placeholder if needed for the generator. */
|
time config name placeholder if needed for the generator. */
|
||||||
|
|
|
@ -1384,7 +1384,7 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmTarget& cmtarget)
|
||||||
|
|
||||||
// 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.
|
||||||
cmLinkImplementation const* impl =
|
cmLinkImplementation const* impl =
|
||||||
cmtarget.GetLinkImplementation("NOCONFIG");
|
gtgt->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)
|
||||||
{
|
{
|
||||||
|
|
|
@ -3564,30 +3564,6 @@ void cmTargetInternals::AddInterfaceEntries(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
|
||||||
const cmLinkImplementation *
|
|
||||||
cmTarget::GetLinkImplementation(const std::string& config) const
|
|
||||||
{
|
|
||||||
// There is no link implementation for imported targets.
|
|
||||||
if(this->IsImported())
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
cmOptionalLinkImplementation& impl = this->GetLinkImplMap(config);
|
|
||||||
if(!impl.LibrariesDone)
|
|
||||||
{
|
|
||||||
impl.LibrariesDone = true;
|
|
||||||
this->ComputeLinkImplementationLibraries(config, impl, this);
|
|
||||||
}
|
|
||||||
if(!impl.LanguagesDone)
|
|
||||||
{
|
|
||||||
impl.LanguagesDone = true;
|
|
||||||
this->ComputeLinkImplementationLanguages(config, impl);
|
|
||||||
}
|
|
||||||
return &impl;
|
|
||||||
}
|
|
||||||
|
|
||||||
cmOptionalLinkImplementation&
|
cmOptionalLinkImplementation&
|
||||||
cmTarget::GetLinkImplMap(std::string const& config) const
|
cmTarget::GetLinkImplMap(std::string const& config) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -231,9 +231,6 @@ public:
|
||||||
|
|
||||||
void GetObjectLibrariesCMP0026(std::vector<cmTarget*>& objlibs) const;
|
void GetObjectLibrariesCMP0026(std::vector<cmTarget*>& objlibs) const;
|
||||||
|
|
||||||
cmLinkImplementation const*
|
|
||||||
GetLinkImplementation(const std::string& config) const;
|
|
||||||
|
|
||||||
cmLinkImplementationLibraries const*
|
cmLinkImplementationLibraries const*
|
||||||
GetLinkImplementationLibraries(const std::string& config) const;
|
GetLinkImplementationLibraries(const std::string& config) const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue