From: Alexander Kanavin Date: Wed, 4 Dec 2024 06:48:49 +0000 (+0100) Subject: cargo.bbclass: do not install libraries by default X-Git-Tag: yocto-5.2~1090 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=68990af9630da16fc75362ca09046ceab71a1106;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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 --- 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