Fix transitive_libs=True when using CMakeConfigDeps for shared libraries#19815
Merged
memsharded merged 17 commits intoApr 27, 2026
Merged
Conversation
transitive_libs=True when using CMakeConfigDeps for shared libraries
memsharded
reviewed
Apr 1, 2026
| dep_target = dep_target or f"{d.ref.name}::{d.ref.name}" | ||
| link_feature = self._cmakedeps.get_property("cmake_link_feature", d) | ||
| link = not (pkg_type is PackageType.SHARED and d.package_type is PackageType.SHARED) | ||
| link = (req.libs or |
Member
There was a problem hiding this comment.
I am just wondering, why reqs.libs is not enough. In theory it should already correctly propagate linkage requirements. Maybe I was too obssesed about the use case of shared->shared that I hardcoded it here, while it is not really necessary. I think it is worth to try and run with link = req.libs only and see what happens with the tests (there should be tests to cover this use case)
aagor
reviewed
Apr 6, 2026
Contributor
There was a problem hiding this comment.
What about this case?
Couldn't there a similar problem?
Or is this not possible (yet)?
But #19641 seems to address this limitation, leading to a similar problem here, right?
….com:AbrilRBS/conan into ar/cmakeconfigdeps-transitive-libraries-link
memsharded
approved these changes
Apr 27, 2026
memsharded
added a commit
to memsharded/conan
that referenced
this pull request
Apr 27, 2026
…aries (conan-io#19815) * Failing test * Porposed fix * Shared * Cleanup API, cleanup example * Better api * Update test_cmakeconfigdeps_new.py * Better use libs * trying if 'req.libs' is enough * Test! * review * new test, more real with transitive_headers=True and static function * Static variant just in case --------- Co-authored-by: Francisco Ramírez <franchuti688@gmail.com> Co-authored-by: memsharded <james@conan.io>
czoido
added a commit
that referenced
this pull request
Apr 28, 2026
…required_conan_version`` (#19907) * decouple new core:policy_conan_version * review, using OR * Extra test case, test cleanup * reduce diff * Fix `transitive_libs=True` when using CMakeConfigDeps for shared libraries (#19815) * Failing test * Porposed fix * Shared * Cleanup API, cleanup example * Better api * Update test_cmakeconfigdeps_new.py * Better use libs * trying if 'req.libs' is enough * Test! * review * new test, more real with transitive_headers=True and static function * Static variant just in case --------- Co-authored-by: Francisco Ramírez <franchuti688@gmail.com> Co-authored-by: memsharded <james@conan.io> * Move some recipe-related deprecations to policy-based (#19892) * Put Conanfile path accessors under conf * Fix tests to use conf * Fix test syntaxt * tests for path methods * Failing test for deprecation * Failing test for deprecation * Core conf * wip * Naming * Use global conf * Typo * Update conan/internal/model/conf.py Co-authored-by: Carlos Zoido <mrgalleta@gmail.com> * Update conan/cli/printers/graph.py Co-authored-by: Carlos Zoido <mrgalleta@gmail.com> * Cleanup conanfile diff * Tests for ensuring we remove support for this in 2.32 --------- Co-authored-by: Carlos Zoido <mrgalleta@gmail.com> * new policies * review * fix tests * fix conf help --------- Co-authored-by: Abril Rincón Blanco <5364255+AbrilRBS@users.noreply.github.com> Co-authored-by: Francisco Ramírez <franchuti688@gmail.com> Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
czoido
pushed a commit
to czoido/conan
that referenced
this pull request
Apr 28, 2026
…aries (conan-io#19815) * Failing test * Porposed fix * Shared * Cleanup API, cleanup example * Better api * Update test_cmakeconfigdeps_new.py * Better use libs * trying if 'req.libs' is enough * Test! * review * new test, more real with transitive_headers=True and static function * Static variant just in case --------- Co-authored-by: Francisco Ramírez <franchuti688@gmail.com> Co-authored-by: memsharded <james@conan.io>
czoido
added a commit
to czoido/conan
that referenced
this pull request
Apr 28, 2026
…required_conan_version`` (conan-io#19907) * decouple new core:policy_conan_version * review, using OR * Extra test case, test cleanup * reduce diff * Fix `transitive_libs=True` when using CMakeConfigDeps for shared libraries (conan-io#19815) * Failing test * Porposed fix * Shared * Cleanup API, cleanup example * Better api * Update test_cmakeconfigdeps_new.py * Better use libs * trying if 'req.libs' is enough * Test! * review * new test, more real with transitive_headers=True and static function * Static variant just in case --------- Co-authored-by: Francisco Ramírez <franchuti688@gmail.com> Co-authored-by: memsharded <james@conan.io> * Move some recipe-related deprecations to policy-based (conan-io#19892) * Put Conanfile path accessors under conf * Fix tests to use conf * Fix test syntaxt * tests for path methods * Failing test for deprecation * Failing test for deprecation * Core conf * wip * Naming * Use global conf * Typo * Update conan/internal/model/conf.py Co-authored-by: Carlos Zoido <mrgalleta@gmail.com> * Update conan/cli/printers/graph.py Co-authored-by: Carlos Zoido <mrgalleta@gmail.com> * Cleanup conanfile diff * Tests for ensuring we remove support for this in 2.32 --------- Co-authored-by: Carlos Zoido <mrgalleta@gmail.com> * new policies * review * fix tests * fix conf help --------- Co-authored-by: Abril Rincón Blanco <5364255+AbrilRBS@users.noreply.github.com> Co-authored-by: Francisco Ramírez <franchuti688@gmail.com> Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog: Bugfix: Fix
transitive_libs=Truewhen usingCMakeConfigDepsfor shared libraries.Docs: Omit
Closes #19801