-
Notifications
You must be signed in to change notification settings - Fork 994
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
Could generators include the current package? #5843
Comments
Thanks for looking at this issue. I don't think this overlaps with toolchains in #5737. Specifically what I'm trying to do is this:
Using the pkgconfig generator, I get pc files for all of the other external libraries, but I do not get a pc file for the local library, because it is part of the consumer recipe. That means I have to manually generate a pc file for it myself. Now, you'd be right to question this wisdom of combining the executable and library in the same recipe. Theoretically, I should be able to have one recipe for the library and one for the executable, then check in a workspace that allows the library and executable to live together in a single git repo. However, workspaces aren't supporting that use case: pre version 1.13.2 the root package couldn't find the build outputs of the library to properly make a pc file; and post version 1.13.2 there are other issues surrounding how those output paths get specified (i.e layouts) and broken out-of-source builds. In both versions, workspaces are not supporting a heterogeneous build system where the library and executable have different toolchains. (I and others have made the suggestion in #5762 to use So I'd love to use workspaces for this, but they aren't (yet) suitable. Therefore, I'm looking for a way to use the pkgconfig generator on the consumer recipe itself. |
|
It would be useful to have generators (such as
cmake
andpkgconfig
) work for the current package.We have a consumer recipe that builds a library and an executable. We want to use one of the generators to link the library with the executable.
Theoretically, one way to do this currently would be to have two recipes, one for the consuming executable and one for the library, where the former finds the latter via conan workspace. Before version 1.13.2, workspaces didn't quite get there. There was no way to specify the paths to the outputs. Since 1.13.2, you can specify those kinds of output paths, but there are a whole host of other workspace issues that make this "monorepo" style build difficult. (See #5762). Therefore, the only way we have been able to accomplish this is to manually generate a .pc file during the build stage. This is unfortunate, since conan already has solved the generator thing. It may be that the right answer is to simply use the two recipes and (some future, improved version of) workspace. I'd be satisfied with that.
Is there any way to run generators on the current package? I realize there is a lifecycle issue here. Normally one executes
conan install
to prepare all the dependencies (including the generators) and it has no knowledge of the package folder for the current recipe. Also it feels somewhat wrong that the build phase would have access to cmake or pc files related to that build (before the build and packaging has even occurred). Nevertheless, we have a use-case that is not served with the current implementation of workspaces.To help us debug your issue please explain:
The text was updated successfully, but these errors were encountered: