Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I 'pass down' feature flags to subdependencies in Cargo?

I'm writing a library in Cargo. If this library depends on another library like libc, which exposes a feature (in this case, use_std), how do I make a feature I expose enable or disable that feature in my dependency?

Looking at the cargo documentation, it looks like there's no official way specified to do this.

like image 580
burtonageo Avatar asked Oct 13 '16 12:10

burtonageo


1 Answers

From the documentation you linked to:

# Features can be used to reexport features of other packages. The `session`
# feature of package `awesome` will ensure that the `session` feature of the
# package `cookie` is also enabled.
session = ["cookie/session"]

Is that sufficient?

like image 97
Shepmaster Avatar answered Oct 19 '22 15:10

Shepmaster