cmGeneratorTarget: Move link iface helpers from cmTarget.
This commit is contained in:
parent
2cb3e57402
commit
8bfb0c53da
|
@ -3362,6 +3362,51 @@ cmGeneratorTarget::ReportPropertyOrigin(const std::string &p,
|
||||||
this->Makefile->GetCMakeInstance()->IssueMessage(cmake::LOG, areport);
|
this->Makefile->GetCMakeInstance()->IssueMessage(cmake::LOG, areport);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
void cmGeneratorTarget::LookupLinkItems(std::vector<std::string> const& names,
|
||||||
|
std::vector<cmLinkItem>& items) const
|
||||||
|
{
|
||||||
|
for(std::vector<std::string>::const_iterator i = names.begin();
|
||||||
|
i != names.end(); ++i)
|
||||||
|
{
|
||||||
|
std::string name = this->Target->CheckCMP0004(*i);
|
||||||
|
if(name == this->GetName() || name.empty())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
items.push_back(cmLinkItem(name, this->Target->FindTargetToLink(name)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
void cmGeneratorTarget::ExpandLinkItems(std::string const& prop,
|
||||||
|
std::string const& value,
|
||||||
|
std::string const& config,
|
||||||
|
cmTarget const* headTarget,
|
||||||
|
bool usage_requirements_only,
|
||||||
|
std::vector<cmLinkItem>& items,
|
||||||
|
bool& hadHeadSensitiveCondition) const
|
||||||
|
{
|
||||||
|
cmGeneratorExpression ge;
|
||||||
|
cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), prop, 0, 0);
|
||||||
|
// The $<LINK_ONLY> expression may be in a link interface to specify private
|
||||||
|
// link dependencies that are otherwise excluded from usage requirements.
|
||||||
|
if(usage_requirements_only)
|
||||||
|
{
|
||||||
|
dagChecker.SetTransitivePropertiesOnly();
|
||||||
|
}
|
||||||
|
std::vector<std::string> libs;
|
||||||
|
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
|
||||||
|
cmSystemTools::ExpandListArgument(cge->Evaluate(
|
||||||
|
this->Makefile,
|
||||||
|
config,
|
||||||
|
false,
|
||||||
|
headTarget,
|
||||||
|
this->Target, &dagChecker), libs);
|
||||||
|
this->LookupLinkItems(libs, items);
|
||||||
|
hadHeadSensitiveCondition = cge->GetHadHeadSensitiveCondition();
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
cmLinkInterface const*
|
cmLinkInterface const*
|
||||||
cmGeneratorTarget::GetLinkInterface(const std::string& config,
|
cmGeneratorTarget::GetLinkInterface(const std::string& config,
|
||||||
|
@ -3644,7 +3689,7 @@ cmGeneratorTarget::ComputeLinkInterfaceLibraries(
|
||||||
if(explicitLibraries)
|
if(explicitLibraries)
|
||||||
{
|
{
|
||||||
// The interface libraries have been explicitly set.
|
// The interface libraries have been explicitly set.
|
||||||
this->Target->ExpandLinkItems(linkIfaceProp, explicitLibraries,
|
this->ExpandLinkItems(linkIfaceProp, explicitLibraries,
|
||||||
config,
|
config,
|
||||||
headTarget, usage_requirements_only,
|
headTarget, usage_requirements_only,
|
||||||
iface.Libraries,
|
iface.Libraries,
|
||||||
|
@ -3673,7 +3718,7 @@ cmGeneratorTarget::ComputeLinkInterfaceLibraries(
|
||||||
if(const char* newExplicitLibraries = this->GetProperty(newProp))
|
if(const char* newExplicitLibraries = this->GetProperty(newProp))
|
||||||
{
|
{
|
||||||
bool hadHeadSensitiveConditionDummy = false;
|
bool hadHeadSensitiveConditionDummy = false;
|
||||||
this->Target->ExpandLinkItems(newProp, newExplicitLibraries, config,
|
this->ExpandLinkItems(newProp, newExplicitLibraries, config,
|
||||||
headTarget, usage_requirements_only,
|
headTarget, usage_requirements_only,
|
||||||
ifaceLibs, hadHeadSensitiveConditionDummy);
|
ifaceLibs, hadHeadSensitiveConditionDummy);
|
||||||
}
|
}
|
||||||
|
@ -3737,14 +3782,14 @@ cmGeneratorTarget::GetImportLinkInterface(const std::string& config,
|
||||||
iface.AllDone = true;
|
iface.AllDone = true;
|
||||||
iface.Multiplicity = info->Multiplicity;
|
iface.Multiplicity = info->Multiplicity;
|
||||||
cmSystemTools::ExpandListArgument(info->Languages, iface.Languages);
|
cmSystemTools::ExpandListArgument(info->Languages, iface.Languages);
|
||||||
this->Target->ExpandLinkItems(info->LibrariesProp, info->Libraries,
|
this->ExpandLinkItems(info->LibrariesProp, info->Libraries,
|
||||||
config,
|
config,
|
||||||
headTarget, usage_requirements_only,
|
headTarget, usage_requirements_only,
|
||||||
iface.Libraries,
|
iface.Libraries,
|
||||||
iface.HadHeadSensitiveCondition);
|
iface.HadHeadSensitiveCondition);
|
||||||
std::vector<std::string> deps;
|
std::vector<std::string> deps;
|
||||||
cmSystemTools::ExpandListArgument(info->SharedDeps, deps);
|
cmSystemTools::ExpandListArgument(info->SharedDeps, deps);
|
||||||
this->Target->LookupLinkItems(deps, iface.SharedDeps);
|
this->LookupLinkItems(deps, iface.SharedDeps);
|
||||||
}
|
}
|
||||||
|
|
||||||
return &iface;
|
return &iface;
|
||||||
|
|
|
@ -404,6 +404,14 @@ private:
|
||||||
GetImportLinkInterface(const std::string& config, cmTarget const* head,
|
GetImportLinkInterface(const std::string& config, cmTarget const* head,
|
||||||
bool usage_requirements_only) const;
|
bool usage_requirements_only) const;
|
||||||
|
|
||||||
|
void ExpandLinkItems(std::string const& prop, std::string const& value,
|
||||||
|
std::string const& config, cmTarget const* headTarget,
|
||||||
|
bool usage_requirements_only,
|
||||||
|
std::vector<cmLinkItem>& items,
|
||||||
|
bool& hadHeadSensitiveCondition) const;
|
||||||
|
void LookupLinkItems(std::vector<std::string> const& names,
|
||||||
|
std::vector<cmLinkItem>& items) const;
|
||||||
|
|
||||||
typedef std::pair<std::string, bool> OutputNameKey;
|
typedef std::pair<std::string, bool> OutputNameKey;
|
||||||
typedef std::map<OutputNameKey, std::string> OutputNameMapType;
|
typedef std::map<OutputNameKey, std::string> OutputNameMapType;
|
||||||
mutable OutputNameMapType OutputNameMap;
|
mutable OutputNameMapType OutputNameMap;
|
||||||
|
|
|
@ -3060,51 +3060,6 @@ bool cmTarget::GetPropertyAsBool(const std::string& prop) const
|
||||||
return cmSystemTools::IsOn(this->GetProperty(prop));
|
return cmSystemTools::IsOn(this->GetProperty(prop));
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
|
||||||
void cmTarget::ExpandLinkItems(std::string const& prop,
|
|
||||||
std::string const& value,
|
|
||||||
std::string const& config,
|
|
||||||
cmTarget const* headTarget,
|
|
||||||
bool usage_requirements_only,
|
|
||||||
std::vector<cmLinkItem>& items,
|
|
||||||
bool& hadHeadSensitiveCondition) const
|
|
||||||
{
|
|
||||||
cmGeneratorExpression ge;
|
|
||||||
cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), prop, 0, 0);
|
|
||||||
// The $<LINK_ONLY> expression may be in a link interface to specify private
|
|
||||||
// link dependencies that are otherwise excluded from usage requirements.
|
|
||||||
if(usage_requirements_only)
|
|
||||||
{
|
|
||||||
dagChecker.SetTransitivePropertiesOnly();
|
|
||||||
}
|
|
||||||
std::vector<std::string> libs;
|
|
||||||
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
|
|
||||||
cmSystemTools::ExpandListArgument(cge->Evaluate(
|
|
||||||
this->Makefile,
|
|
||||||
config,
|
|
||||||
false,
|
|
||||||
headTarget,
|
|
||||||
this, &dagChecker), libs);
|
|
||||||
this->LookupLinkItems(libs, items);
|
|
||||||
hadHeadSensitiveCondition = cge->GetHadHeadSensitiveCondition();
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
|
||||||
void cmTarget::LookupLinkItems(std::vector<std::string> const& names,
|
|
||||||
std::vector<cmLinkItem>& items) const
|
|
||||||
{
|
|
||||||
for(std::vector<std::string>::const_iterator i = names.begin();
|
|
||||||
i != names.end(); ++i)
|
|
||||||
{
|
|
||||||
std::string name = this->CheckCMP0004(*i);
|
|
||||||
if(name == this->GetName() || name.empty())
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
items.push_back(cmLinkItem(name, this->FindTargetToLink(name)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
const char* cmTarget::GetSuffixVariableInternal(bool implib) const
|
const char* cmTarget::GetSuffixVariableInternal(bool implib) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -558,14 +558,6 @@ private:
|
||||||
GetLinkImplementationLibrariesInternal(const std::string& config,
|
GetLinkImplementationLibrariesInternal(const std::string& config,
|
||||||
cmTarget const* head) const;
|
cmTarget const* head) const;
|
||||||
|
|
||||||
void ExpandLinkItems(std::string const& prop, std::string const& value,
|
|
||||||
std::string const& config, cmTarget const* headTarget,
|
|
||||||
bool usage_requirements_only,
|
|
||||||
std::vector<cmLinkItem>& items,
|
|
||||||
bool& hadHeadSensitiveCondition) const;
|
|
||||||
void LookupLinkItems(std::vector<std::string> const& names,
|
|
||||||
std::vector<cmLinkItem>& items) const;
|
|
||||||
|
|
||||||
std::string ProcessSourceItemCMP0049(const std::string& s);
|
std::string ProcessSourceItemCMP0049(const std::string& s);
|
||||||
|
|
||||||
void ClearLinkMaps();
|
void ClearLinkMaps();
|
||||||
|
|
Loading…
Reference in New Issue