diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2022-07-03 16:16:37 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2022-07-05 08:00:04 (GMT) |
commit | e8792da04b7980c11e0b1b62ea618953876d1f39 (patch) | |
tree | 44ce8851025edc83e29eeebba19406095f16fabe /Source | |
parent | 2a336d855443d7db601bd79e80fce86726962cd2 (diff) | |
download | CMake-e8792da04b7980c11e0b1b62ea618953876d1f39.zip CMake-e8792da04b7980c11e0b1b62ea618953876d1f39.tar.gz CMake-e8792da04b7980c11e0b1b62ea618953876d1f39.tar.bz2 |
genex-LINK_LIBRARY: ensure correct generation inside LINK_GROUP genex
This fix ensures the following pattern is correctly handled:
$<LINK_GROUP:group_feat,$<LINK_LIBRARY:lib_feat,mylib>>
With:
CMAKE_LINK_GROUP_USING_group_feat = "—START_GROUP" "—END_GROUP"
CMAKE_LINK_LIBRARY_USING_lib_feat = "—PREFIX" "—LINK <LIBRARY>" "—SUFFIX"
Before the fix, we get the following generation:
—START_GROUP —PREFIX —LINK /path/to/mylib —END_GROUP —SUFFIX
—END_GROUP and —SUFFIX are in the wrong order
After the fix, we get the correct order:
—START_GROUP —PREFIX —LINK /path/to/mylib —SUFFIX —END_GROUP
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index e156e3d..850b7a3 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -549,6 +549,17 @@ bool cmComputeLinkInformation::Compute() if (linkEntry.Kind == cmComputeLinkDepends::LinkEntry::Group) { const auto& groupFeature = this->GetGroupFeature(linkEntry.Feature); if (groupFeature.Supported) { + if (linkEntry.Item.Value == "</LINK_GROUP>" && + currentFeature != nullptr) { + // emit feature suffix, if any + if (!currentFeature->Suffix.empty()) { + this->Items.emplace_back( + BT<std::string>{ currentFeature->Suffix, + this->Items.back().Value.Backtrace }, + ItemIsPath::No); + } + currentFeature = nullptr; + } this->Items.emplace_back( BT<std::string>{ linkEntry.Item.Value == "<LINK_GROUP>" ? groupFeature.Prefix |