Skip to content

Conversation

@AbrilRBS
Copy link
Member

@AbrilRBS AbrilRBS commented Jan 8, 2026

Changelog: Feature: Add a way to specify link features ($<LINK_LIBRARY:...>) in CMakeConfigDeps.
Docs: conan-io/docs#4353

Users are expected to only set the feature where it makes sense (ie, no whole_archive for shared libs)

Closes #19385 if merged

# set property allows to append, and lib_info[requires] will iterate
set_property(TARGET {{lib}} APPEND PROPERTY INTERFACE_LINK_LIBRARIES
{% if link_info["link_feature"] %}
"$<LINK_LIBRARY:{{link_info["link_feature"]}},{{config_wrapper(config, require_target)}}>")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would need a version check?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the minimum CMake that supports this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.24 as per https://cmake.org/cmake/help/latest/variable/CMAKE_LINK_LIBRARY_USING_FEATURE.html, which is lower than CMakeConfigDeps so we're ok if I'm not mistaken?

@AbrilRBS AbrilRBS marked this pull request as ready for review January 13, 2026 22:04
@AbrilRBS AbrilRBS changed the title Add a way to specify $<LINK_LIBRARY:...> for CMakeConfigDeps Add a way to specify link features in CMakeConfigDeps Jan 14, 2026
@AbrilRBS AbrilRBS added this to the 2.25.0 milestone Jan 25, 2026
@memsharded memsharded self-assigned this Jan 26, 2026
AbrilRBS and others added 2 commits January 26, 2026 13:10
Co-authored-by: James <memsharded@gmail.com>
Co-authored-by: James <memsharded@gmail.com>
@memsharded memsharded merged commit 9ac4028 into conan-io:develop2 Jan 26, 2026
16 checks passed
@AbrilRBS AbrilRBS deleted the ar/cmake-link-feature branch January 27, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] Add ccp_info property for libs to expose their need to be linked as $<LINK_LIBRARY:WHOLE_ARCHIVE,...>

2 participants