diff options
author | Alex Kiernan <alex.kiernan@gmail.com> | 2023-12-08 12:00:27 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-12-09 19:17:11 +0000 |
commit | dddfe1e3f4135d974c6692071e08f6e0a96df1b3 (patch) | |
tree | 430850e551952c1b7d9f6060e69fb151f4b17fce | |
parent | 43df94f7af8422ebd1f2884992349ff1baae232b (diff) | |
download | poky-dddfe1e3f4135d974c6692071e08f6e0a96df1b3.tar.gz |
rust: cargo: Convert single-valued variables to weak defaults
All of these variables are single-valued, so we can use weak-defaults
for them and only see the final assignment after parsing.
(From OE-Core rev: 3221e82a35a149fdf38fe66dcd5de758ac1b9185)
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes-recipe/cargo_common.bbclass | 6 | ||||
-rw-r--r-- | meta/classes-recipe/rust-common.bbclass | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/meta/classes-recipe/cargo_common.bbclass b/meta/classes-recipe/cargo_common.bbclass index 509aa195c5..48cdd69bca 100644 --- a/meta/classes-recipe/cargo_common.bbclass +++ b/meta/classes-recipe/cargo_common.bbclass | |||
@@ -28,10 +28,10 @@ export PKG_CONFIG_ALLOW_CROSS = "1" | |||
28 | # Don't instruct cargo to use crates downloaded by bitbake. Some rust packages, | 28 | # Don't instruct cargo to use crates downloaded by bitbake. Some rust packages, |
29 | # for example the rust compiler itself, come with their own vendored sources. | 29 | # for example the rust compiler itself, come with their own vendored sources. |
30 | # Specifying two [source.crates-io] will not work. | 30 | # Specifying two [source.crates-io] will not work. |
31 | CARGO_DISABLE_BITBAKE_VENDORING ?= "0" | 31 | CARGO_DISABLE_BITBAKE_VENDORING ??= "0" |
32 | 32 | ||
33 | # Used by libstd-rs to point to the vendor dir included in rustc src | 33 | # Used by libstd-rs to point to the vendor dir included in rustc src |
34 | CARGO_VENDORING_DIRECTORY ?= "${CARGO_HOME}/bitbake" | 34 | CARGO_VENDORING_DIRECTORY ??= "${CARGO_HOME}/bitbake" |
35 | 35 | ||
36 | # The directory of the Cargo.toml relative to the root directory, per default | 36 | # The directory of the Cargo.toml relative to the root directory, per default |
37 | # assume there's a Cargo.toml directly in the root directory | 37 | # assume there's a Cargo.toml directly in the root directory |
@@ -40,7 +40,7 @@ CARGO_SRC_DIR ??= "" | |||
40 | # The actual path to the Cargo.toml | 40 | # The actual path to the Cargo.toml |
41 | CARGO_MANIFEST_PATH ??= "${S}/${CARGO_SRC_DIR}/Cargo.toml" | 41 | CARGO_MANIFEST_PATH ??= "${S}/${CARGO_SRC_DIR}/Cargo.toml" |
42 | 42 | ||
43 | CARGO_RUST_TARGET_CCLD ?= "${RUST_TARGET_CCLD}" | 43 | CARGO_RUST_TARGET_CCLD ??= "${RUST_TARGET_CCLD}" |
44 | cargo_common_do_configure () { | 44 | cargo_common_do_configure () { |
45 | mkdir -p ${CARGO_HOME}/bitbake | 45 | mkdir -p ${CARGO_HOME}/bitbake |
46 | 46 | ||
diff --git a/meta/classes-recipe/rust-common.bbclass b/meta/classes-recipe/rust-common.bbclass index ae96d9c5b1..6940093e59 100644 --- a/meta/classes-recipe/rust-common.bbclass +++ b/meta/classes-recipe/rust-common.bbclass | |||
@@ -16,8 +16,8 @@ FILES:${PN}-dbg += "${rustlibdir}/.debug" | |||
16 | RUSTLIB = "-L ${STAGING_DIR_HOST}${rustlibdir}" | 16 | RUSTLIB = "-L ${STAGING_DIR_HOST}${rustlibdir}" |
17 | RUST_DEBUG_REMAP = "--remap-path-prefix=${WORKDIR}=${TARGET_DBGSRC_DIR}" | 17 | RUST_DEBUG_REMAP = "--remap-path-prefix=${WORKDIR}=${TARGET_DBGSRC_DIR}" |
18 | RUSTFLAGS += "${RUSTLIB} ${RUST_DEBUG_REMAP}" | 18 | RUSTFLAGS += "${RUSTLIB} ${RUST_DEBUG_REMAP}" |
19 | RUSTLIB_DEP ?= "libstd-rs" | 19 | RUSTLIB_DEP ??= "libstd-rs" |
20 | RUST_PANIC_STRATEGY ?= "unwind" | 20 | RUST_PANIC_STRATEGY ??= "unwind" |
21 | 21 | ||
22 | def target_is_armv7(d): | 22 | def target_is_armv7(d): |
23 | '''Determine if target is armv7''' | 23 | '''Determine if target is armv7''' |