Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] Do traits of a recipe affect files generated by CMakeDeps for transitive recipes? #13723

Open
1 task done
SpaceIm opened this issue Apr 19, 2023 · 0 comments
Open
1 task done

Comments

@SpaceIm
Copy link
Contributor

SpaceIm commented Apr 19, 2023

What is your question?

After some experimentations of tricky recipes in conan-center, I have the feeling that dowtream traits affect files generated by CMakeDeps for transitive dependencies, instead of affecting the downstream recipe. Is it correct?

Example:

  • libA depends on libB, no traits (so libB is private)
  • libA & libB shared

Now in test package of libA, we just require libA, and for some reason we want to call find_package(libB REQUIRED) & link libB::libB target. When I do this, headers are not found, even though libB::libB is explicitly linked in CMakeLists of test package. So my understanding is that files generated by CMakeDeps for libB depend on libA and requirements() content of root conanfile, and it's very weird. I would have expected that traits logic would live in config files of libA, not libB.

I know that for conan, it's a hack to link libB::libB if it's a transitive dependency, but for some recipes it's impossible to add an explicit require to libB in test package (when it depends on options of libA for example, which can't be evaluated in requirements() of test package, or when versioning compatibility is tricky).

Some concrete examples:

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
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

No branches or pull requests

1 participant