How to activate Cargo features based on the target platform? #2687
Unanswered
easy-Coder
asked this question in
Q&A
Replies: 1 comment
-
Hi, this seems like a general rust question, eg maybe try |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to use Rust's feature flags to conditionally compile code, but I need these features to be enabled automatically depending on the target platform (e.g., enable my_desktop_feature only when building for Linux, Windows, or macOS).
How can I configure my Cargo.toml or build process so that specific features are automatically activated based on the target triple (like linux, mac, window)?
I fail to see any questions like this, but if it already exist please let me know.
Beta Was this translation helpful? Give feedback.
All reactions