rust.md 1.3 KB

Create an empty project:

$ xmake create -l rust -t console test

For more examples, see: Rust Examples

Add cargo package dependences

example: https://github.com/xmake-io/xmake/tree/dev/tests/projects/rust/cargo_deps

Integrating Cargo.toml dependency packages

Integrating dependencies directly using add_requires("cargo::base64 0.13.0") above has a problem.

If there are a lot of dependencies and several dependencies all depend on the same child dependencies, then there will be a redefinition problem, so if we use the full Cargo.toml to manage the dependencies we won't have this problem.

For example

For a complete example see: cargo_deps_with_toml

Use cxxbridge to call rust in c++

Call c++ in rust