cmTarget: Refactor internal imported LinkInterface map
Create the map entry up front and store in it a boolean value indicating whether the LinkInterface structure has been populated. This approach leads to shorter code that is easier to follow too.
This commit is contained in:
parent
102eea60cd
commit
1ca0c0e94a
|
@ -135,7 +135,7 @@ public:
|
||||||
LinkInterfaceMapType LinkInterfaceUsageRequirementsOnlyMap;
|
LinkInterfaceMapType LinkInterfaceUsageRequirementsOnlyMap;
|
||||||
bool PolicyWarnedCMP0022;
|
bool PolicyWarnedCMP0022;
|
||||||
|
|
||||||
typedef std::map<TargetConfigPair, cmTarget::LinkInterface>
|
typedef std::map<TargetConfigPair, OptionalLinkInterface>
|
||||||
ImportLinkInterfaceMapType;
|
ImportLinkInterfaceMapType;
|
||||||
ImportLinkInterfaceMapType ImportLinkInterfaceMap;
|
ImportLinkInterfaceMapType ImportLinkInterfaceMap;
|
||||||
ImportLinkInterfaceMapType ImportLinkInterfaceUsageRequirementsOnlyMap;
|
ImportLinkInterfaceMapType ImportLinkInterfaceUsageRequirementsOnlyMap;
|
||||||
|
@ -5977,26 +5977,21 @@ cmTarget::GetImportLinkInterface(const std::string& config,
|
||||||
this->Internal->ImportLinkInterfaceUsageRequirementsOnlyMap :
|
this->Internal->ImportLinkInterfaceUsageRequirementsOnlyMap :
|
||||||
this->Internal->ImportLinkInterfaceMap);
|
this->Internal->ImportLinkInterfaceMap);
|
||||||
|
|
||||||
cmTargetInternals::ImportLinkInterfaceMapType::iterator i = lim.find(key);
|
cmTargetInternals::OptionalLinkInterface& iface = lim[key];
|
||||||
if(i == lim.end())
|
if(!iface.AllDone)
|
||||||
{
|
{
|
||||||
LinkInterface iface;
|
iface.AllDone = true;
|
||||||
iface.Multiplicity = info->Multiplicity;
|
iface.Multiplicity = info->Multiplicity;
|
||||||
cmSystemTools::ExpandListArgument(info->Languages, iface.Languages);
|
cmSystemTools::ExpandListArgument(info->Languages, iface.Languages);
|
||||||
this->ExpandLinkItems(info->LibrariesProp, info->Libraries, config,
|
this->ExpandLinkItems(info->LibrariesProp, info->Libraries, config,
|
||||||
headTarget, usage_requirements_only,
|
headTarget, usage_requirements_only,
|
||||||
iface.Libraries);
|
iface.Libraries);
|
||||||
{
|
|
||||||
std::vector<std::string> deps;
|
std::vector<std::string> deps;
|
||||||
cmSystemTools::ExpandListArgument(info->SharedDeps, deps);
|
cmSystemTools::ExpandListArgument(info->SharedDeps, deps);
|
||||||
this->LookupLinkItems(deps, iface.SharedDeps);
|
this->LookupLinkItems(deps, iface.SharedDeps);
|
||||||
}
|
}
|
||||||
|
|
||||||
cmTargetInternals::ImportLinkInterfaceMapType::value_type
|
return &iface;
|
||||||
entry(key, iface);
|
|
||||||
i = lim.insert(entry).first;
|
|
||||||
}
|
|
||||||
return &i->second;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue