From 68990af9630da16fc75362ca09046ceab71a1106 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Wed, 4 Dec 2024 07:48:49 +0100 Subject: [PATCH] cargo.bbclass: do not install libraries by default 'cargo install' only installs executables and examples into the system, and we should follow that. Libraries are vendored into build trees from the crate registry and then baked directly into executables. Neverthless, there's now a condition variable, so individual recipes can opt into installing libraries if there's a use case for it. Signed-off-by: Alexander Kanavin Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- meta/classes-recipe/cargo.bbclass | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/meta/classes-recipe/cargo.bbclass b/meta/classes-recipe/cargo.bbclass index 0829a58dd90..b583f84bdfd 100644 --- a/meta/classes-recipe/cargo.bbclass +++ b/meta/classes-recipe/cargo.bbclass @@ -61,9 +61,11 @@ cargo_do_install () { for tgt in "${B}/target/${CARGO_TARGET_SUBDIR}/"*; do case $tgt in *.so|*.rlib) - install -d "${D}${rustlibdir}" - install -m755 "$tgt" "${D}${rustlibdir}" - have_installed=true + if [ -n "${CARGO_INSTALL_LIBRARIES}" ]; then + install -d "${D}${rustlibdir}" + install -m755 "$tgt" "${D}${rustlibdir}" + have_installed=true + fi ;; *examples) if [ -d "$tgt" ]; then -- 2.47.3