Enable dependency feature only if dependency enabled

Is it possible to have a feature enable a dependency feature but only if that dependency is otherwise enabled?

name = "dep"

featureA = []


name = "applib"

use_dep = ["dep"]
featureA = ["dep/featureA"]

So featureA exists in both packages, and I'd like to pass it through to dep, but only if use_dep is specified. Is there a way to do this in cargo without creating use_dep_with_featureA?


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.