fornwall / rust-script

Run Rust files and expressions as scripts without any setup or compilation step.
https://rust-script.org
Apache License 2.0
1.2k stars 41 forks source link

Configure the build options #116

Open joseluis opened 11 months ago

joseluis commented 11 months ago

I'd love to be able to use rust-script to run no_std scripts that depend on custom build options, which normally are configured inside the .cargo/config.toml file. e.g.:

[build]
target = "x86_64-unknown-none"
rustflags = ["-C", "link-args=-N", "-C", "relocation-model=static"]

Ideally I'd love to be able to specify a section like this in the header:

//! ```config
//! [build]
//! target = "x86_64-unknown-none"
//! rustflags = ["-C", "link-args=-N", "-C", "relocation-model=static"]
//! ```

and it would be copied to the appropriate place like it happens now with the Cargo.toml.