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
dependency not inherited? #495
Comments
You have to use |
I saw that short ago. Thanks, it helps. I just have one question remaining: my package depends on boost publicly:
|
You shouldn't have to care about the individual include paths of the dependency... but if for some reason you had to, I don't believe you can. Maybe post a sample of what you're trying to do... |
My use case is the following: I have a library to be consumed (internally) by an executable in a sibling project:
|
@jpakkane the documentation for @germandiagogomez
|
@rhd Thank you. I like meson more and more 👍 @jpakkane: one more thing I would like to ask. Projects have includes that should be private (only used in .cpp files, for example if I include <somelib.h> privately) and some that should be propagated (used in .h files). Is this kind of propagation segregation supported? It is like CMake PRIVATE and PUBLIC modifier. If we have this, visual studio (I saw a lot of moves there lately) and XCode, I think I would definitely switch to meson. I am liking it way more than cmake. |
If you don't add the include path to the
|
I want to know this correctly. Sorry because I have no access to the machine with the meson build as of now, I could check then. Here my question:
I really feel it would be much more ergonomic to distiguish between public and private dependencies directly in If I can accomplish the same, it is still quite ok. |
Yes, it will.
You're right
Yea, maybe. I don't mind the explicit Jussi, will have to give more details about why things are the way they are... but for me, meson is pretty great. |
👍 I think the difference between a lib and a dependency is confusing. They should be In library target you can have include_directories, but these are private. In a dependency
For a library target I would use something (maybe, need to give more thought):
The result would look like this:
I think this is a bit cleaner and for a newcomer, she understands which includes are of what kind. I am not sure but I think that there should also be public and private dependencies. Currently we have "private dependencies" only in library targets. The example then would become in my case:
What do you think? |
If you're original issue is resolved, you should probably close this issue and start another with the specific feature request. I'm not sure I like the extra Look at test case 93. Looks like some work was started re: private directories... but I'm not sure what the status is... Besides that, there seems to be a documentation problem with |
Sorry I haven't commented on this, busy with other stuff. This is a tricky issue because you need to inherit dependencies in some cases even if they appear to be secret. For example:
In this case you must put the deps when linking the executable and not when linking the static library. Similarly if the dep is self-built static lib that has deps on its own. I'll try to look into this during the weekend. |
Yes, true. I think that when things are linked should be an implementation detail actually: if a static library has a dependency, not in the meson sense strictly, the build system should do bookeeping of that. The command line to issue should be independent of this. Is this doable? |
There is a very strong semantic reason to do this. A library is just that, a collection of code to link against. A dependency is something bigger: a library + all the headers etc needed to build and link against it. The reason this is so has to do with the development history. Originally we had only In practice it might be useful to think of declare_dependency as a sort of internal pkg-config (which is what it is). Thus you would group your projects like this:
Projects that use this lib as a subproject would only use There are two different build types here, the public usage and internal usage by unit tests. Thus you need two different declarations. |
As a matter of discoverability, people who know how it works in CMake will be searching for the As a matter of practicality, Meson's |
Hello,
I have the following config:
The problem is that I do not inherit the boost includes when I link my exe to libProject target.
I think this should work --> the dependency is a libProject dependency, not a dependency
from exeProject. Is there any workaround for this?
The text was updated successfully, but these errors were encountered: