Cargo build for all or some specific features


#1

Hi

I have two exclusive features A and B in my cargo that they pull different crates and I want to make a unified crate out of them so I was wondering how to include both when building a module common? do we have #[cfg(all(features))] or #[cfg(any(features = "A", features = "B"))] or something similar? I haven’t found anything yet though!


#2

This is correct.


#3

Thanks for the clarifications! but it doesn’t work and I cannot import the one with features “A” in one crate and “B” in another later!


#4

Ah, nevermind! seems typo is allowed feature not features.