11
Cargo env file? (lemmy.physfluids.fr)

Hello,

I have a project for which some machines have only a subset of features set. Currently, I write

cargo run --no-default-features --features "toto,titi" --bin my_bin

This is a bit cumbersome and I sometimes forget the --no-default-features --features part. I was wondering if there is a local config file that I could put in the directory to instruct cargo to use this particular subset of features. I guess this should be in the documentation, but I didn't find it.

you are viewing a single comment's thread
view the rest of the comments
[-] owsei@programming.dev 1 points 6 months ago

You can setup a cargo configuration file, in it you put a manifest and define some profiles, and in them define what features you want compiled

[-] japps13@lemmy.physfluids.fr 2 points 6 months ago

This would look like it would be what I am looking for, but the documentation of the configuration file does not mention features.

[-] owsei@programming.dev 1 points 6 months ago

https://doc.rust-lang.org/cargo/reference/manifest.html

it's the sixth from the bottom in the table of contents

this post was submitted on 18 Mar 2024
11 points (92.3% liked)

Rust

5754 readers
28 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 1 year ago
MODERATORS