@@ -22,14 +22,17 @@ RUST_BUILD = "${@rust_target(d, 'BUILD')}"
22
22
23
23
# Additional flags passed directly to the "cargo build" invocation
24
24
EXTRA_CARGO_FLAGS ??= ""
25
- EXTRA_RUSTFLAGS ??= ""
26
- RUSTFLAGS += "${EXTRA_RUSTFLAGS} "
25
+
26
+ # Optional RUSTFLAGS
27
+ RUSTFLAGS ??= ""
27
28
28
29
# Space-separated list of features to enable
29
30
CARGO_FEATURES ??= ""
30
31
31
32
# 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 )}"
33
36
34
37
CARGO_INSTALL_DIR ?= "${D}${bindir} "
35
38
@@ -49,8 +52,6 @@ WRAPPER_DIR = "${WORKDIR}/wrappers"
49
52
# Set the Cargo manifest path to the typical location
50
53
CARGO_MANIFEST_PATH ?= "${S} /Cargo.toml"
51
54
52
- FILES :${PN} -dev += "${libdir} /*.rlib"
53
-
54
55
CARGO_BUILD_FLAGS = "\
55
56
--offline \
56
57
--verbose \
@@ -119,7 +120,6 @@ cargo_bin_do_compile() {
119
120
export CARGO_TARGET_APPLIES_TO_HOST = "false"
120
121
export CARGO_TARGET_ ${@ rust_target (d , 'TARGET' ). replace ('-' , '_' ). upper ()}_LINKER = "${WRAPPER_DIR} /linker-wrapper.sh"
121
122
export CARGO_HOST_LINKER = "${WRAPPER_DIR} /linker-native-wrapper.sh"
122
- export CARGO_BUILD_FLAGS = "-C rpath"
123
123
export CARGO_PROFILE_RELEASE_DEBUG = "true"
124
124
125
125
# The CC crate defaults to using CFLAGS when compiling everything. We can
0 commit comments