diff options
author | Brad King <brad.king@kitware.com> | 2021-06-22 16:59:37 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-07-13 15:31:16 (GMT) |
commit | 33f0505f015c766b62a9c6b0d3961fe71b405d06 (patch) | |
tree | 30fd297b89ba89817db6c3ce2be75e1db47f4dc4 /Source/cmGeneratorTarget.cxx | |
parent | 460e812369db398da34e14c9d40c3ecec06afaf1 (diff) | |
download | CMake-33f0505f015c766b62a9c6b0d3961fe71b405d06.zip CMake-33f0505f015c766b62a9c6b0d3961fe71b405d06.tar.gz CMake-33f0505f015c766b62a9c6b0d3961fe71b405d06.tar.bz2 |
cmGeneratorTarget: Simplify ExpandLinkItems signature
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 47 |
1 files changed, 17 insertions, 30 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) { |