-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
System dependencies #145
Comments
@wycats and I also discussed this at great length, and we ended up coming to a very similar but slightly tweaked solution. The main idea is a syntax extension: https://github.com/alexcrichton/link-config. At compile-time the syntax extension detects It's still a work in progress, but I don't think that we need a |
In fact I had a similar idea a few days ago, but with CMake: https://github.com/Tomaka17/cmake-rs The problem I encountered is that I couldn't detect the path where to put the libraries (ie. |
Cargo passes |
But this is only for the If you implement a syntax extension, then you need to pass these variables when building regular targets, except if your idea is to write |
The purpose of the syntax extension is to discover native dependencies, not to build them currently. This could be expanded in the future, however. |
This solution does not solve the problem posed by libraries like rust_stb_image. |
That is the intention of the
|
@alexcrichton can you elaborate how the syntax extension will get cargo to add an additional |
That's one of the drawbacks of the current syntax extension. You can compile a crate locally by adding extra |
@alexcrichton we should decide on some canonical solution to this problem, implement what we need to, and then document it. This seems like a somewhat common problem, and even if the solution is somewhat involved, having a clear path for people (ideally as portable as possible) would help a lot. |
|
Now that #792 is landed, I think this is basically done. I've included documentation for our solution to this problem in that PR (will soon be pushed to doc.crates.io). If you have any questions, feel free to ask me! |
Fairly long discussion: https://gist.github.com/cmr/10e1633ba7e9569af4b9
The takeway, I think, is that there will be a
pkg-*
class of packages. These will integrate with pkg-config to query how to link to a given system dependency, with the ability to fall back on a bundled version that is then built.The text was updated successfully, but these errors were encountered: