创建空工程:
$ xmake create -l rust -t console test
更多例子见:Rust Examples
例子: https://github.com/xmake-io/xmake/tree/dev/tests/projects/rust/cargo_deps
上面直接使用 add_requires("cargo::base64 0.13.0") 的方式集成依赖,会有一个问题:
如果依赖很多,并且有几个依赖都共同依赖了相同的子依赖,那么会出现重定义问题,因此如果我们使用完整的 Cargo.toml 去管理依赖就不会存在这个问题。
例如:
完整例子见:cargo_deps_with_toml