--features as string

Are the --features flags passed to rustc/cargo somehow available as literal strings/array?
Rationale: I want to inspect what features a user given when doing some checks in 'build.rs'

Looks like you can use environment variables like CARGO_FEATURE_XYZ to detect this:

https://doc.rust-lang.org/stable/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts

thanks least expected it as env var :slight_smile:

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.