Skip to content

Commit 8fe424b

Browse files
committed
specify install dir via CARGO_INSTALL_DIR
Signed-off-by: Yang Hongbo <yanghongbo@iotpi.io>
1 parent 3e2a7fc commit 8fe424b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

classes/cargo.bbclass

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ CARGO_FEATURES ??= ""
3131
# Control the Cargo build type (debug or release)
3232
CARGO_BUILD_TYPE ?= "--release"
3333

34+
CARGO_INSTALL_DIR ?= "${D}${bindir}"
35+
3436
CARGO_DEBUG_DIR = "${B}/${RUST_TARGET}/debug"
3537
CARGO_RELEASE_DIR = "${B}/${RUST_TARGET}/release"
3638
WRAPPER_DIR = "${WORKDIR}/wrappers"
@@ -126,7 +128,7 @@ cargo_do_compile() {
126128
}
127129

128130
cargo_do_install() {
129-
install -d "${D}${bindir}"
131+
install -d "${CARGO_INSTALL_DIR}"
130132
if [ "${CARGO_BUILD_TYPE}" = "--release" ]; then
131133
local cargo_bindir="${CARGO_RELEASE_DIR}"
132134
else
@@ -136,7 +138,7 @@ cargo_do_install() {
136138
local files_installed=""
137139
for f in "$cargo_bindir"/*; do
138140
if [ -f "$f" ] && [ -x "$f" ]; then
139-
install -m 0755 "$f" "${D}${bindir}"
141+
install -m 0755 "$f" "${CARGO_INSTALL_DIR}"
140142
files_installed="$files_installed $f"
141143
fi
142144
done

0 commit comments

Comments
 (0)