Skip to content

Commit ffddef5

Browse files
committed
aws-greengrass-component-sdk: add bindgen rust c code gen funct for debug
1 parent c5d2c6a commit ffddef5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

recipes-sdk/aws-greengrass-component-sdk/aws-greengrass-component-sdk_0.4.bb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ do_configure:prepend() {
3030
rm -f ${S}/rust/src/c.rs
3131
}
3232

33+
# Manual bindgen task for debugging (not called automatically)
34+
# Usage: bitbake aws-greengrass-component-sdk -c create_bindings
35+
do_create_bindings[depends] += "bindgen-cli-native:do_populate_sysroot clang-native:do_populate_sysroot"
36+
do_create_bindings() {
37+
${STAGING_BINDIR_NATIVE}/bindgen ${S}/rust/wrapper.h -o ${S}/rust/src/c.rs \
38+
--allowlist-type "Gg.*" \
39+
--allowlist-function "gg_.*" \
40+
--allowlist-var "GG_.*" \
41+
-- -I${S}/include --target=${RUST_HOST_SYS}
42+
bbnote "Generated bindings at ${S}/rust/src/c.rs"
43+
}
44+
3345
# Set LIBCLANG_PATH for bindgen
3446
export LIBCLANG_PATH = "${STAGING_LIBDIR_NATIVE}"
3547

0 commit comments

Comments
 (0)