mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
target_link_libraries: Fix out-of-dir linking of a list of targets
In a case like
target_link_libraries(targetInOtherDir PUBLIC "$<1:a;b>")
then all entries in the list need to be looked up in the caller's
scope. Previously our `::@(directory-id)` suffix would apply only
to the last entry. Instead surround the entire entry by a pair
`::@(directory-id);...;::@` so that the `::@` syntax can encode
a directory lookup scope change evaluated as the list is processed.
Fixes: #20204
This commit is contained in:
@@ -378,9 +378,14 @@ public:
|
||||
cmGeneratorTarget* Target = nullptr;
|
||||
};
|
||||
TargetOrString ResolveTargetReference(std::string const& name) const;
|
||||
TargetOrString ResolveTargetReference(std::string const& name,
|
||||
cmLocalGenerator const* lg) const;
|
||||
|
||||
cmLinkItem ResolveLinkItem(std::string const& name,
|
||||
cmListFileBacktrace const& bt) const;
|
||||
cmLinkItem ResolveLinkItem(std::string const& name,
|
||||
cmListFileBacktrace const& bt,
|
||||
cmLocalGenerator const* lg) const;
|
||||
|
||||
// Compute the set of languages compiled by the target. This is
|
||||
// computed every time it is called because the languages can change
|
||||
@@ -919,6 +924,9 @@ private:
|
||||
|
||||
std::unordered_set<std::string> UnityBatchedSourceFiles;
|
||||
|
||||
bool IsLinkLookupScope(std::string const& n,
|
||||
cmLocalGenerator const*& lg) const;
|
||||
|
||||
void ExpandLinkItems(std::string const& prop, std::string const& value,
|
||||
std::string const& config,
|
||||
const cmGeneratorTarget* headTarget,
|
||||
|
||||
Reference in New Issue
Block a user