this post was submitted on 18 Mar 2024
11 points (92.3% liked)
Rust
6124 readers
17 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
The way I can think of to do this is to make a program called
cargo-build-env
which reads a file of your choosing with the features and executes cargo, then place that binary in your~/.cargo/bin
directory. Then you can runcargo build-env
to build your programThe program can be in any language as long as it's executable, including shell script
Yeah, a simple bash script should do. Such as:
Then just set a BUILD_FEATURES env var.