cmLinkItem: Convert to a "sum type" over a string and target pointer

Avoid exposing the item name implicitly as std::string.  When the item
is a target, avoid storing a second copy of its name.

Most link item construction is paired with calls to `FindTargetToLink`
to get the possible target pointer.  Rename these methods to
`ResolveLinkItem` and refactor them to construct the entire item.
This commit is contained in:
Brad King
2018-09-06 13:10:55 -04:00
parent f782759ed0
commit fc7e4d1ed8
10 changed files with 145 additions and 66 deletions
+1 -1
View File
@@ -357,7 +357,7 @@ public:
cmOptionalLinkImplementation& impl,
const cmGeneratorTarget* head) const;
cmGeneratorTarget* FindTargetToLink(std::string const& name) const;
cmLinkItem ResolveLinkItem(std::string const& name) const;
// Compute the set of languages compiled by the target. This is
// computed every time it is called because the languages can change