rust: Add cmake support for building rust apps
This provides the function `rust_cargo_application()` within Cmake to
give applications written in Rust a simple way to start.
This implements the basic functionality needed to build a rust
application on Arm, including target mapping, and invoking cargo during
the build.
Most of the functionality is about passing the appropriate flags to
`cargo`, which is used to perform the actual build of the rust code.
Cargo generates `librustapp.a` which is added to the link dependencies
for the application.
The cargo rule is written such that cargo will always be built (provided
`app` is being built), as there will be complex dependencies on the
cargo side. Cargo will not modify the `librustapp.a` file if nothing
needs to be build, so this will generally be fast if there are no
changes to files that affect the Rust build.
Signed-off-by:
David Brown <david.brown@linaro.org>
Loading
Please sign in to comment