1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-22 16:07:49 +08:00

cmComputeLinkDepends: Factor out string literals as named constants

This commit is contained in:
Brad King
2024-09-18 18:49:22 -04:00
parent 3bd73fcc76
commit 80b469a51d

View File

@@ -315,8 +315,10 @@ const LinkLibraryFeatureAttributeSet& GetLinkLibraryFeatureAttributes(
} }
// LINK_GROUP helpers // LINK_GROUP helpers
const auto LG_BEGIN = "<LINK_GROUP:"_s; const cm::string_view LG_BEGIN = "<LINK_GROUP:"_s;
const auto LG_END = "</LINK_GROUP:"_s; const cm::string_view LG_END = "</LINK_GROUP:"_s;
const cm::string_view LG_ITEM_BEGIN = "<LINK_GROUP>"_s;
const cm::string_view LG_ITEM_END = "</LINK_GROUP>"_s;
inline std::string ExtractGroupFeature(std::string const& item) inline std::string ExtractGroupFeature(std::string const& item)
{ {
@@ -488,13 +490,13 @@ public:
if (it == this->FinalEntries.end()) { if (it == this->FinalEntries.end()) {
break; break;
} }
it->Item.Value = "</LINK_GROUP>"; it->Item.Value = std::string(LG_ITEM_END);
for (auto index = g.second.rbegin(); index != g.second.rend(); for (auto index = g.second.rbegin(); index != g.second.rend();
++index) { ++index) {
it = this->FinalEntries.insert(it, this->Entries[*index]); it = this->FinalEntries.insert(it, this->Entries[*index]);
} }
it = this->FinalEntries.insert(it, groupEntry); it = this->FinalEntries.insert(it, groupEntry);
it->Item.Value = "<LINK_GROUP>"; it->Item.Value = std::string(LG_ITEM_BEGIN);
} }
} }
} }