Closed
Description
It would be awesome if build scripts could build fully-made crates in the $OUT_DIR folder, including a Cargo.toml, which the library could then depend on.
I'm not sure of the best way to implement this, but here are a few iedas:
- Add support for parsing a
cargo:add-local-dependency:$path
output from the build script - Add support for environmental variables in
Cargo.toml
, so you could use:
[dependencies.generated-module] path = "$OUT_DIR/generated-module/"
The reasoning for doing this instead of just include!()
ing the code is for build scripts which generate code which depends on some crates.io library which the main program does not.
Here's my use case for this:
Adding this would allow for a rust program to accept (at compilation time) self-dependent plugin
rust files, with dependency information in comments at the top of the file. build.rs
would generate a Cargo.toml including what the plugin depends on, which the main library could then depend on.
Metadata
Metadata
Assignees
Labels
No labels