cmTarget: Simplify internal ComputeLinkInterfaceLibraries method
Now that the method can see the full OptionalLinkInterface structure, store information there instead of passing it through arguments.
This commit is contained in:
parent
b0f5740851
commit
102eea60cd
@ -122,14 +122,12 @@ public:
|
|||||||
void ComputeLinkInterface(cmTarget const* thisTarget,
|
void ComputeLinkInterface(cmTarget const* thisTarget,
|
||||||
const std::string& config,
|
const std::string& config,
|
||||||
OptionalLinkInterface& iface,
|
OptionalLinkInterface& iface,
|
||||||
cmTarget const* head,
|
cmTarget const* head) const;
|
||||||
const char *explicitLibraries) const;
|
void ComputeLinkInterfaceLibraries(cmTarget const* thisTarget,
|
||||||
const char* ComputeLinkInterfaceLibraries(cmTarget const* thisTarget,
|
|
||||||
const std::string& config,
|
const std::string& config,
|
||||||
OptionalLinkInterface& iface,
|
OptionalLinkInterface& iface,
|
||||||
cmTarget const* head,
|
cmTarget const* head,
|
||||||
bool usage_requirements_only,
|
bool usage_requirements_only);
|
||||||
bool &exists);
|
|
||||||
|
|
||||||
typedef std::map<TargetConfigPair, OptionalLinkInterface>
|
typedef std::map<TargetConfigPair, OptionalLinkInterface>
|
||||||
LinkInterfaceMapType;
|
LinkInterfaceMapType;
|
||||||
@ -5908,17 +5906,15 @@ cmTarget::LinkInterface const* cmTarget::GetLinkInterface(
|
|||||||
if(!iface.LibrariesDone)
|
if(!iface.LibrariesDone)
|
||||||
{
|
{
|
||||||
iface.LibrariesDone = true;
|
iface.LibrariesDone = true;
|
||||||
iface.ExplicitLibraries =
|
|
||||||
this->Internal->ComputeLinkInterfaceLibraries(
|
this->Internal->ComputeLinkInterfaceLibraries(
|
||||||
this, config, iface, head, false, iface.Exists);
|
this, config, iface, head, false);
|
||||||
}
|
}
|
||||||
if(!iface.AllDone)
|
if(!iface.AllDone)
|
||||||
{
|
{
|
||||||
iface.AllDone = true;
|
iface.AllDone = true;
|
||||||
if(iface.Exists)
|
if(iface.Exists)
|
||||||
{
|
{
|
||||||
this->Internal->ComputeLinkInterface(this, config, iface,
|
this->Internal->ComputeLinkInterface(this, config, iface, head);
|
||||||
head, iface.ExplicitLibraries);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5956,9 +5952,8 @@ cmTarget::GetLinkInterfaceLibraries(const std::string& config,
|
|||||||
if(!iface.LibrariesDone)
|
if(!iface.LibrariesDone)
|
||||||
{
|
{
|
||||||
iface.LibrariesDone = true;
|
iface.LibrariesDone = true;
|
||||||
iface.ExplicitLibraries =
|
|
||||||
this->Internal->ComputeLinkInterfaceLibraries(
|
this->Internal->ComputeLinkInterfaceLibraries(
|
||||||
this, config, iface, head, usage_requirements_only, iface.Exists);
|
this, config, iface, head, usage_requirements_only);
|
||||||
}
|
}
|
||||||
|
|
||||||
return iface.Exists? &iface : 0;
|
return iface.Exists? &iface : 0;
|
||||||
@ -6081,14 +6076,13 @@ void cmTarget::GetTransitivePropertyTargets(const std::string& config,
|
|||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
const char*
|
void
|
||||||
cmTargetInternals::ComputeLinkInterfaceLibraries(
|
cmTargetInternals::ComputeLinkInterfaceLibraries(
|
||||||
cmTarget const* thisTarget,
|
cmTarget const* thisTarget,
|
||||||
const std::string& config,
|
const std::string& config,
|
||||||
OptionalLinkInterface& iface,
|
OptionalLinkInterface& iface,
|
||||||
cmTarget const* headTarget,
|
cmTarget const* headTarget,
|
||||||
bool usage_requirements_only,
|
bool usage_requirements_only)
|
||||||
bool &exists)
|
|
||||||
{
|
{
|
||||||
// Construct the property name suffix for this configuration.
|
// Construct the property name suffix for this configuration.
|
||||||
std::string suffix = "_";
|
std::string suffix = "_";
|
||||||
@ -6165,10 +6159,10 @@ cmTargetInternals::ComputeLinkInterfaceLibraries(
|
|||||||
(thisTarget->GetType() == cmTarget::EXECUTABLE ||
|
(thisTarget->GetType() == cmTarget::EXECUTABLE ||
|
||||||
(thisTarget->GetType() == cmTarget::MODULE_LIBRARY)))
|
(thisTarget->GetType() == cmTarget::MODULE_LIBRARY)))
|
||||||
{
|
{
|
||||||
exists = false;
|
return;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
exists = true;
|
iface.Exists = true;
|
||||||
|
iface.ExplicitLibraries = explicitLibraries;
|
||||||
|
|
||||||
if(explicitLibraries)
|
if(explicitLibraries)
|
||||||
{
|
{
|
||||||
@ -6247,17 +6241,15 @@ cmTargetInternals::ComputeLinkInterfaceLibraries(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return explicitLibraries;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmTargetInternals::ComputeLinkInterface(cmTarget const* thisTarget,
|
void cmTargetInternals::ComputeLinkInterface(cmTarget const* thisTarget,
|
||||||
const std::string& config,
|
const std::string& config,
|
||||||
OptionalLinkInterface& iface,
|
OptionalLinkInterface& iface,
|
||||||
cmTarget const* headTarget,
|
cmTarget const* headTarget) const
|
||||||
const char* explicitLibraries) const
|
|
||||||
{
|
{
|
||||||
if(explicitLibraries)
|
if(iface.ExplicitLibraries)
|
||||||
{
|
{
|
||||||
if(thisTarget->GetType() == cmTarget::SHARED_LIBRARY
|
if(thisTarget->GetType() == cmTarget::SHARED_LIBRARY
|
||||||
|| thisTarget->GetType() == cmTarget::STATIC_LIBRARY
|
|| thisTarget->GetType() == cmTarget::STATIC_LIBRARY
|
||||||
|
Loading…
x
Reference in New Issue
Block a user