我有板条箱A
and B
. A
依赖于取决于B
and B
有一个名为some_feature
.
我可以建造B
通过运行使用货物cargo build --features=some_feature
,但是我如何为A
我可以选择启用或禁用some_feature
对于底层板条箱B
编译时A
?
您可以简单地转发指定的功能A
:
# A/Cargo.toml
[features]
some-feature = ["B/some-feature"]
[dependencies]
B = "*"
这将编译B
with --features=some_feature
如果你通过--features=some_feature
to A
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)