Skip to content

Commit 23267b4

Browse files
committed
feat: enable debug build; fix: rustflags
1 parent dc0c25c commit 23267b4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

classes/cargo_bin.bbclass

+6-6
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@ RUST_BUILD = "${@rust_target(d, 'BUILD')}"
2222

2323
# Additional flags passed directly to the "cargo build" invocation
2424
EXTRA_CARGO_FLAGS ??= ""
25-
EXTRA_RUSTFLAGS ??= ""
26-
RUSTFLAGS += "${EXTRA_RUSTFLAGS}"
25+
26+
# Optional RUSTFLAGS
27+
RUSTFLAGS ??= ""
2728

2829
# Space-separated list of features to enable
2930
CARGO_FEATURES ??= ""
3031

3132
# Control the Cargo build type (debug or release)
32-
CARGO_BUILD_PROFILE ?= "release"
33+
# This is based on the content of CARGO_BUILD_FLAGS and generally will need to
34+
# change if CARGO_BUILD_FLAGS changes.
35+
CARGO_BUILD_PROFILE ?= "${@oe.utils.conditional('DEBUG_BUILD', '1', 'debug', 'release', d)}"
3336

3437
CARGO_INSTALL_DIR ?= "${D}${bindir}"
3538

@@ -49,8 +52,6 @@ WRAPPER_DIR = "${WORKDIR}/wrappers"
4952
# Set the Cargo manifest path to the typical location
5053
CARGO_MANIFEST_PATH ?= "${S}/Cargo.toml"
5154

52-
FILES:${PN}-dev += "${libdir}/*.rlib"
53-
5455
CARGO_BUILD_FLAGS = "\
5556
--offline \
5657
--verbose \
@@ -119,7 +120,6 @@ cargo_bin_do_compile() {
119120
export CARGO_TARGET_APPLIES_TO_HOST="false"
120121
export CARGO_TARGET_${@rust_target(d, 'TARGET').replace('-','_').upper()}_LINKER="${WRAPPER_DIR}/linker-wrapper.sh"
121122
export CARGO_HOST_LINKER="${WRAPPER_DIR}/linker-native-wrapper.sh"
122-
export CARGO_BUILD_FLAGS="-C rpath"
123123
export CARGO_PROFILE_RELEASE_DEBUG="true"
124124

125125
# The CC crate defaults to using CFLAGS when compiling everything. We can

0 commit comments

Comments
 (0)