Open lucabonifacio opened 3 years ago
Hi @lucabonifacio
at the moment (Conan 1.X), all requires
are by default public, and linkage requirements are propagated to the consumers. This is because Conan graph model has requires
and build_requires```, but there is nothing inside
requires`` that allows to define the visibility of the transitive requirements.
Conan 2.0 introduces a new model that does exactly this. Check this Tribe 2.0 proposal: https://github.com/conan-io/tribe/pull/26
In Conan 1.X there are 2 alternatives:
Hi @memsharded
Are there already some release date for Conan 2.0?
Not for final release. We are entering now (today) in alpha stage, check the https://github.com/conan-io/conan/releases. There will be a few months in alpha and a few months in beta.
Hi @memsharded !
after a short debugging session within the package_info() method of a recipe, I saw that a yet undocumented property self.cpp_info.public_deps
is available for manipulation.
setting it in my example from the original value ['boost']
to []
causes the public dependency to disappear from the user package include paths unless the dependency is directly required.
Is the manipulation of this public_deps an unintentional feature, or is it safe to use for this purpose?
Hi @dornbirndevelops
Please don't use undocumented things in your recipe code, those will easily break, and if you do it, it is at your own risk. Specifically this one has already been removed in the new model, it will not exist via the self.dependencies
model
Let's take following simplified example:
Now, let's assume we want to consume
Foo
:Now, having
OpenSSL
defined as a private dependency ofFoo
means thatApp
can link against it, but cannot include any API of it. Instead, in case ofBoost
,App
can use it within the application.CMake, when generating the Package Configuration Files, uses
$<LINK_ONLY:...>
to specify private link dependencies without other usage requirements.My question is, how can I describe the PUBLIC / PRIVATE separation within
package_info()
?