-
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
Optional dependencies #427
Comments
This is certainly planned! We're going to support this through the planned feature of profiles and features. |
cc #385 |
Not sure how this addresses the problem at all.
What I read in #385 sounds like I'll have to write a classical configure file that creates a make file that calls cargo with the correct flags. |
Due to cargo's nature of encouraging repeatable builds, this will likely manifest itself with features in that you explicitly opt in to building a feature and then the build will go awry if a system dependency was not discovered. Otherwise I suspect that syntax extensions will serve the purpose of determining whether a dependency is available locally or not. |
Consider the case of a music player that supports multiple codecs. To compile such a program, the build system has to find out which libraries are currently available on the system and has to compile only those parts that use the available libraries. For rust this includes passing --cfg arguments to the compiler.
This is true not only for binaries but also for libraries that might use bindgen to create bindings from the header files.
Since checking for dependencies might take some time, this step should not be executed with cargo build every time.
The text was updated successfully, but these errors were encountered: