Cargo, flags for dependencies


#1

Hi All,

I am working on a project that has both an open and closed source part.

I split the project between a root crate and few other dependency, auxiliary, crates.

Now I would like to use features flags to activate or not some option, however I do need to pass the same flags not only to the root crate but also to the crates on which the root depends on, the “auxiliary” crates.

I wasn’t able to find a solution to this problem. Is some of you aware of what I could try?

Cheers,

Simone


#2

Cargo allows re-exporting a dependent crate’s features via your own crate. There’re some examples in the docs: https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section.


#3

Thank you :slight_smile: