From 4e960136779edb39685b018a0bfc023402e22d72 Mon Sep 17 00:00:00 2001 From: Benjamin Isbarn Date: Mon, 15 Feb 2021 14:36:46 +0100 Subject: [PATCH] Factor in `CARGO_SRC_DIR` when setting `MANIFEST_PATH`. --- classes/cargo.bbclass | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/classes/cargo.bbclass b/classes/cargo.bbclass index 72e77b0..c2eee10 100644 --- a/classes/cargo.bbclass +++ b/classes/cargo.bbclass @@ -22,8 +22,12 @@ B = "${WORKDIR}/build" # where the issue occured export RUST_BACKTRACE = "1" -# Assume there's a Cargo.toml directly in the source directory -MANIFEST_PATH ??= "${S}/Cargo.toml" +# The directory of the Cargo.toml relative to the root directory, per default +# assume there's a Cargo.toml directly in the root directory +CARGO_SRC_DIR ??= "" + +# The actual path to the Cargo.toml +MANIFEST_PATH ??= "${S}/${CARGO_SRC_DIR}/Cargo.toml" RUSTFLAGS ??= "" BUILD_MODE = "${@['--release', ''][d.getVar('DEBUG_BUILD') == '1']}"