]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
rust: provide examples for C library generation in rust
authorFrederic Martinsons <frederic.martinsons@gmail.com>
Thu, 17 Aug 2023 05:04:15 +0000 (07:04 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 21 Aug 2023 15:14:27 +0000 (16:14 +0100)
commitbb177c7764b1bc47157d57d7a34930e59a7acef3
treeb4aa6b2948f2d9963d89456fe5a08ad9be7efa65
parent1e4862db1d6293872b76b62acee1e4a5e2597367
rust: provide examples for C library generation in rust

rust-c-lib-example is a little rust code which provide
a single function to print a formatted date (via the chrono crate)
from an input timestamp in millisecond. It has the necessary FFI
annotation and inherit cargo_c class for the C ABI compatible
library generation.

rust-c-lib-example is meson project for the C code which
will call the print_date function from rust-c-lib-example
if no argument is provided, if any argument is provided
it will print "Hello world in rust from C!"

add a runtime test case to check if all went well.

Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta-selftest/recipes-devtools/rust/rust-c-lib-example-bin_git.bb [new file with mode: 0644]
meta-selftest/recipes-devtools/rust/rust-c-lib-example-crates.inc [new file with mode: 0644]
meta-selftest/recipes-devtools/rust/rust-c-lib-example_git.bb [new file with mode: 0644]
meta/lib/oeqa/runtime/cases/rust.py