cmGeneratorTarget: Simplify CMP0022 warning check

Since commit 1d709ea2f5 (cmGeneratorTarget: Propagate backtraces from
INTERFACE_LINK_LIBRARIES, 2021-12-15) we can use the special storage of
the property directly.
This commit is contained in:
Brad King 2022-01-05 15:14:13 -05:00
parent 216aa14997
commit f3e9e03fe0

View File

@ -57,6 +57,7 @@ using LinkInterfaceFor = cmGeneratorTarget::LinkInterfaceFor;
const cmsys::RegularExpression FrameworkRegularExpression( const cmsys::RegularExpression FrameworkRegularExpression(
"^(.*/)?([^/]*)\\.framework/(.*)$"); "^(.*/)?([^/]*)\\.framework/(.*)$");
const std::string kINTERFACE_LINK_LIBRARIES = "INTERFACE_LINK_LIBRARIES";
} }
template <> template <>
@ -7250,13 +7251,9 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries(
// Compare the link implementation fallback link interface to the // Compare the link implementation fallback link interface to the
// preferred new link interface property and warn if different. // preferred new link interface property and warn if different.
cmLinkInterface ifaceNew; cmLinkInterface ifaceNew;
static const std::string newProp = "INTERFACE_LINK_LIBRARIES"; this->ExpandLinkItems(kINTERFACE_LINK_LIBRARIES,
if (cmValue newExplicitLibraries = this->GetProperty(newProp)) { this->Target->GetLinkInterfaceEntries(), config,
std::vector<BT<std::string>> entries; headTarget, interfaceFor, ifaceNew);
entries.emplace_back(*newExplicitLibraries);
this->ExpandLinkItems(linkIfaceProp, cmMakeRange(entries), config,
headTarget, interfaceFor, ifaceNew);
}
if (ifaceNew.Libraries != iface.Libraries) { if (ifaceNew.Libraries != iface.Libraries) {
std::string oldLibraries = cmJoin(impl->Libraries, ";"); std::string oldLibraries = cmJoin(impl->Libraries, ";");
std::string newLibraries = cmJoin(ifaceNew.Libraries, ";"); std::string newLibraries = cmJoin(ifaceNew.Libraries, ";");