summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-02-09 14:28:05 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-02-09 14:28:20 (GMT)
commite40cea3fe99dc79b1ce8bc8330f662ec3a36dc8e (patch)
tree444d13efd4e6a4844c57a209c4392102250a0969 /Source/cmGeneratorTarget.cxx
parent3d5466d5e95869380b38e40f8431a19e8a6d458e (diff)
parent2a6b0415d71db893b6d8edd1c5058d42eb40fca6 (diff)
downloadCMake-e40cea3fe99dc79b1ce8bc8330f662ec3a36dc8e.zip
CMake-e40cea3fe99dc79b1ce8bc8330f662ec3a36dc8e.tar.gz
CMake-e40cea3fe99dc79b1ce8bc8330f662ec3a36dc8e.tar.bz2
Merge topic 'genex-LINK_LIBRARY-to-decorate-library'
2a6b0415d7 $<LINK_LIBRARY>: Add LINK_LIBRARY_OVERRIDE target property 42965799b4 Genex: Add $<LINK_LIBRARY:...> 78dd7d5292 cmRulePlaceholderExpander: add base class for placeholder expansion reuse 4b55828a9f cmExpandListWithBacktrace: add handling of empty elements. 28d7432468 cmComputeLinkInformation: use cmComputeLinkDepends::LinkEntry Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6769
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 602065a..e722fa9 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -4629,7 +4629,8 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetLinkOptions(
}
std::vector<BT<std::string>>& cmGeneratorTarget::ResolveLinkerWrapper(
- std::vector<BT<std::string>>& result, const std::string& language) const
+ std::vector<BT<std::string>>& result, const std::string& language,
+ bool joinItems) const
{
// replace "LINKER:" prefixed elements by actual linker wrapper
const std::string wrapper(this->Makefile->GetSafeDefinition(
@@ -4688,7 +4689,14 @@ std::vector<BT<std::string>>& cmGeneratorTarget::ResolveLinkerWrapper(
std::vector<BT<std::string>> options = wrapOptions(
linkerOptions, bt, wrapperFlag, wrapperSep, concatFlagAndArgs);
- result.insert(entry, options.begin(), options.end());
+ if (joinItems) {
+ result.insert(entry,
+ cmJoin(cmRange<decltype(options.cbegin())>(
+ options.cbegin(), options.cend()),
+ " "_s));
+ } else {
+ result.insert(entry, options.begin(), options.end());
+ }
}
return result;
}
@@ -6381,7 +6389,8 @@ bool cmGeneratorTarget::VerifyLinkItemIsTarget(LinkItemRole role,
std::string const& str = item.AsStr();
if (!str.empty() &&
(str[0] == '-' || str[0] == '$' || str[0] == '`' ||
- str.find_first_of("/\\") != std::string::npos)) {
+ str.find_first_of("/\\") != std::string::npos ||
+ cmHasPrefix(str, "<LINK_LIBRARY:"_s))) {
return true;
}