diff options
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 47 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.h | 7 |
2 files changed, 19 insertions, 35 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 300c13b..47975af 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -6372,12 +6372,12 @@ cm::optional<cmLinkItem> cmGeneratorTarget::LookupLinkItem( return maybeItem; } -void cmGeneratorTarget::ExpandLinkItems( - std::string const& prop, std::string const& value, std::string const& config, - cmGeneratorTarget const* headTarget, bool usage_requirements_only, - std::vector<cmLinkItem>& items, std::vector<cmLinkItem>& objects, - bool& hadHeadSensitiveCondition, bool& hadContextSensitiveCondition, - bool& hadLinkLanguageSensitiveCondition) const +void cmGeneratorTarget::ExpandLinkItems(std::string const& prop, + std::string const& value, + std::string const& config, + cmGeneratorTarget const* headTarget, + bool usage_requirements_only, + cmLinkInterface& iface) const { // Keep this logic in sync with ComputeLinkImplementationLibraries. cmGeneratorExpression ge; @@ -6406,17 +6406,17 @@ void cmGeneratorTarget::ExpandLinkItems( cmSourceFile const* sf = mf->GetSource(maybeObj, cmSourceFileLocationKind::Known); if (sf && sf->GetPropertyAsBool("EXTERNAL_OBJECT")) { - objects.emplace_back(std::move(*maybeItem)); + iface.Objects.emplace_back(std::move(*maybeItem)); continue; } } } - items.emplace_back(std::move(*maybeItem)); + iface.Libraries.emplace_back(std::move(*maybeItem)); } } - hadHeadSensitiveCondition = cge->GetHadHeadSensitiveCondition(); - hadContextSensitiveCondition = cge->GetHadContextSensitiveCondition(); - hadLinkLanguageSensitiveCondition = + iface.HadHeadSensitiveCondition = cge->GetHadHeadSensitiveCondition(); + iface.HadContextSensitiveCondition = cge->GetHadContextSensitiveCondition(); + iface.HadLinkLanguageSensitiveCondition = cge->GetHadLinkLanguageSensitiveCondition(); } @@ -6918,10 +6918,7 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries( if (explicitLibraries) { // The interface libraries have been explicitly set. this->ExpandLinkItems(linkIfaceProp, *explicitLibraries, config, - headTarget, usage_requirements_only, iface.Libraries, - iface.Objects, iface.HadHeadSensitiveCondition, - iface.HadContextSensitiveCondition, - iface.HadLinkLanguageSensitiveCondition); + headTarget, usage_requirements_only, iface); return; } @@ -6942,22 +6939,15 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries( !this->PolicyWarnedCMP0022 && !usage_requirements_only) { // Compare the link implementation fallback link interface to the // preferred new link interface property and warn if different. - std::vector<cmLinkItem> ifaceLibs; - std::vector<cmLinkItem> ifaceObjects; + cmLinkInterface ifaceNew; static const std::string newProp = "INTERFACE_LINK_LIBRARIES"; if (cmProp newExplicitLibraries = this->GetProperty(newProp)) { - bool hadHeadSensitiveConditionDummy = false; - bool hadContextSensitiveConditionDummy = false; - bool hadLinkLanguageSensitiveConditionDummy = false; this->ExpandLinkItems(newProp, *newExplicitLibraries, config, - headTarget, usage_requirements_only, ifaceLibs, - ifaceObjects, hadHeadSensitiveConditionDummy, - hadContextSensitiveConditionDummy, - hadLinkLanguageSensitiveConditionDummy); + headTarget, usage_requirements_only, ifaceNew); } - if (ifaceLibs != iface.Libraries) { + if (ifaceNew.Libraries != iface.Libraries) { std::string oldLibraries = cmJoin(impl->Libraries, ";"); - std::string newLibraries = cmJoin(ifaceLibs, ";"); + std::string newLibraries = cmJoin(ifaceNew.Libraries, ";"); if (oldLibraries.empty()) { oldLibraries = "(empty)"; } @@ -7095,10 +7085,7 @@ const cmLinkInterface* cmGeneratorTarget::GetImportLinkInterface( iface.Multiplicity = info->Multiplicity; cmExpandList(info->Languages, iface.Languages); this->ExpandLinkItems(info->LibrariesProp, info->Libraries, config, - headTarget, usage_requirements_only, iface.Libraries, - iface.Objects, iface.HadHeadSensitiveCondition, - iface.HadContextSensitiveCondition, - iface.HadLinkLanguageSensitiveCondition); + headTarget, usage_requirements_only, iface); std::vector<std::string> deps = cmExpandedList(info->SharedDeps); LookupLinkItemScope scope{ this->LocalGenerator }; for (std::string const& dep : deps) { diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 09f4167..bd4e08f 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -1041,11 +1041,8 @@ private: std::string const& config, const cmGeneratorTarget* headTarget, bool usage_requirements_only, - std::vector<cmLinkItem>& items, - std::vector<cmLinkItem>& objects, - bool& hadHeadSensitiveCondition, - bool& hadContextSensitiveCondition, - bool& hadLinkLanguageSensitiveCondition) const; + cmLinkInterface& iface) const; + struct LookupLinkItemScope { cmLocalGenerator const* LG; |