Skip to content

Commit f0ecf57

Browse files
authored
Merge pull request #163 from rust-embedded/custom-cargo-profiles
Allow custom build profiles to be specified
2 parents 1f5f9fb + 9a3aba4 commit f0ecf57

33 files changed

+4
-1915
lines changed

classes/cargo_bin.bbclass

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@ RUSTFLAGS += "${EXTRA_RUSTFLAGS}"
2929
CARGO_FEATURES ??= ""
3030

3131
# Control the Cargo build type (debug or release)
32-
CARGO_BUILD_TYPE ?= "--release"
32+
CARGO_BUILD_PROFILE ?= "release"
3333

3434
CARGO_INSTALL_DIR ?= "${D}${bindir}"
3535

36-
CARGO_DEBUG_DIR = "${B}/${RUST_TARGET}/debug"
37-
CARGO_RELEASE_DIR = "${B}/${RUST_TARGET}/release"
36+
CARGO_BINDIR = "${B}/${RUST_TARGET}/${CARGO_BUILD_PROFILE}"
3837
WRAPPER_DIR = "${WORKDIR}/wrappers"
3938

4039
# Set the Cargo manifest path to the typical location
@@ -46,7 +45,7 @@ CARGO_BUILD_FLAGS = "\
4645
--verbose \
4746
--manifest-path ${CARGO_MANIFEST_PATH} \
4847
--target=${RUST_TARGET} \
49-
${CARGO_BUILD_TYPE} \
48+
--profile=${CARGO_BUILD_PROFILE} \
5049
${@oe.utils.conditional('CARGO_FEATURES', '', '', '--features "${CARGO_FEATURES}"', d)} \
5150
${EXTRA_CARGO_FLAGS} \
5251
"
@@ -120,15 +119,9 @@ cargo_bin_do_compile() {
120119
}
121120

122121
cargo_bin_do_install() {
123-
if [ "${CARGO_BUILD_TYPE}" = "--release" ]; then
124-
local cargo_bindir="${CARGO_RELEASE_DIR}"
125-
else
126-
local cargo_bindir="${CARGO_DEBUG_DIR}"
127-
fi
128-
129122
local files_installed=""
130123

131-
for tgt in "${cargo_bindir}"/*; do
124+
for tgt in "${CARGO_BINDIR}"/*; do
132125
case $tgt in
133126
*.so|*.rlib)
134127
install -d "${D}${libdir}"

recipes-devtools/rust/cargo-bin-cross_1.40.0.bb

Lines changed: 0 additions & 50 deletions
This file was deleted.

recipes-devtools/rust/cargo-bin-cross_1.41.1.bb

Lines changed: 0 additions & 50 deletions
This file was deleted.

recipes-devtools/rust/cargo-bin-cross_1.44.0.bb

Lines changed: 0 additions & 50 deletions
This file was deleted.

recipes-devtools/rust/cargo-bin-cross_1.45.2.bb

Lines changed: 0 additions & 50 deletions
This file was deleted.

recipes-devtools/rust/cargo-bin-cross_1.46.0.bb

Lines changed: 0 additions & 50 deletions
This file was deleted.

recipes-devtools/rust/cargo-bin-cross_1.47.0.bb

Lines changed: 0 additions & 50 deletions
This file was deleted.

recipes-devtools/rust/cargo-bin-cross_1.48.0.bb

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)