diff options
author | Frederic Martinsons <frederic.martinsons@gmail.com> | 2023-08-17 07:04:15 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-08-21 16:15:35 +0100 |
commit | 5116f2b2cf3d00fc2c9f41f8ce3661ed7bb4975e (patch) | |
tree | 6aa9a1a1267e7229afe8f969c4fa4548c94cfdb7 /meta-selftest/recipes-devtools/rust/rust-c-lib-example_git.bb | |
parent | c318d1914e0b65e04b945f67651a56c2699eb969 (diff) | |
download | poky-5116f2b2cf3d00fc2c9f41f8ce3661ed7bb4975e.tar.gz |
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.
(From OE-Core rev: bb177c7764b1bc47157d57d7a34930e59a7acef3)
Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta-selftest/recipes-devtools/rust/rust-c-lib-example_git.bb')
-rw-r--r-- | meta-selftest/recipes-devtools/rust/rust-c-lib-example_git.bb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/meta-selftest/recipes-devtools/rust/rust-c-lib-example_git.bb b/meta-selftest/recipes-devtools/rust/rust-c-lib-example_git.bb new file mode 100644 index 0000000000..6e7c250b92 --- /dev/null +++ b/meta-selftest/recipes-devtools/rust/rust-c-lib-example_git.bb | |||
@@ -0,0 +1,15 @@ | |||
1 | DESCRIPTION = "A simple example for rust C library" | ||
2 | HOMEPAGE = "https://gitlab.com/fmartinsonsHome/rust-c-lib-example" | ||
3 | LICENSE = "MIT" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=cb9c441273ed8a029701a086befbfc63" | ||
5 | |||
6 | SRC_URI = " \ | ||
7 | git://gitlab.com/fmartinsonsHome/rust-c-lib-example.git;branch=main;protocol=https \ | ||
8 | " | ||
9 | |||
10 | SRCREV = "fc53c457f69aa5221ec1f8619a007e8150db5e60" | ||
11 | S = "${WORKDIR}/git" | ||
12 | |||
13 | inherit cargo_c | ||
14 | |||
15 | require ${BPN}-crates.inc | ||