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.

(From OE-Core rev: 68990af9630da16fc75362ca09046ceab71a1106)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexander Kanavin
2024-12-04 07:48:49 +01:00
committed by Richard Purdie
parent d04c561cf5
commit 003ea0b573

View File

@@ -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