@@ -31,7 +31,7 @@ B = "${WORKDIR}/build"
export RUST_BACKTRACE = "1"
RUSTFLAGS ??= ""
-BUILD_MODE = "${@['--release', ''][d.getVar('DEBUG_BUILD') == '1']}"
+BUILD_MODE ??= "--release"
# --frozen flag will prevent network access (which is required since only
# the do_fetch step is authorized to access network)
# and will require an up to date Cargo.lock file.
@@ -41,7 +41,7 @@ CARGO_BUILD_FLAGS = "-v --frozen --target ${RUST_HOST_SYS} ${BUILD_MODE} --manif
# This is based on the content of CARGO_BUILD_FLAGS and generally will need to
# change if CARGO_BUILD_FLAGS changes.
-BUILD_DIR = "${@['release', 'debug'][d.getVar('DEBUG_BUILD') == '1']}"
+BUILD_DIR ??= "release"
CARGO_TARGET_SUBDIR = "${RUST_HOST_SYS}/${BUILD_DIR}"
oe_cargo_build () {
export RUSTFLAGS="${RUSTFLAGS}"
@@ -38,6 +38,10 @@ INHIBIT_SYSROOT_STRIP:class-native ?= "1"
# For meson.bbclass
MESON_BUILDTYPE ?= "debug"
+# For cargo.bbclass
+BUILD_MODE ?= ""
+BUILD_DIR ?= "debug"
+
CPPFLAGS:append:arm::pn-lttng-ust = " -DUATOMIC_NO_LINK_ERROR"
EXTRA_OECMAKE:remove:pn-webkitgtk = "-DWEBKIT_NO_INLINE_HINTS=OFF"
The debug_build_tune.inc is used to collect debug tuning configuration, override BUILD_MODE and BUILD_DIR for cargo.bbclass when DEBUG_BUILD is enabled Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> --- meta/classes-recipe/cargo.bbclass | 4 ++-- meta/conf/distro/include/debug_build_tune.inc | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-)