diff options
author | Brad King <brad.king@kitware.com> | 2021-06-22 17:05:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-07-13 15:52:58 (GMT) |
commit | 8112480921557ef7d290b3ff3038c22152539d53 (patch) | |
tree | 57b4658ef704dcb743af5da56419bba9e194a214 /Source/cmGeneratorTarget.cxx | |
parent | 33f0505f015c766b62a9c6b0d3961fe71b405d06 (diff) | |
download | CMake-8112480921557ef7d290b3ff3038c22152539d53.zip CMake-8112480921557ef7d290b3ff3038c22152539d53.tar.gz CMake-8112480921557ef7d290b3ff3038c22152539d53.tar.bz2 |
cmGeneratorTarget: Clarify ExpandLinkItems local variable role
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 47975af..7933750 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -6399,19 +6399,22 @@ void cmGeneratorTarget::ExpandLinkItems(std::string const& prop, for (std::string const& lib : libs) { if (cm::optional<cmLinkItem> maybeItem = this->LookupLinkItem(lib, cge->GetBacktrace(), &scope)) { - if (!maybeItem->Target) { + cmLinkItem item = std::move(*maybeItem); + + if (!item.Target) { // Report explicitly linked object files separately. - std::string const& maybeObj = maybeItem->AsStr(); + std::string const& maybeObj = item.AsStr(); if (cmSystemTools::FileIsFullPath(maybeObj)) { cmSourceFile const* sf = mf->GetSource(maybeObj, cmSourceFileLocationKind::Known); if (sf && sf->GetPropertyAsBool("EXTERNAL_OBJECT")) { - iface.Objects.emplace_back(std::move(*maybeItem)); + iface.Objects.emplace_back(std::move(item)); continue; } } } - iface.Libraries.emplace_back(std::move(*maybeItem)); + + iface.Libraries.emplace_back(std::move(item)); } } iface.HadHeadSensitiveCondition = cge->GetHadHeadSensitiveCondition(); |