mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-05 12:16:41 +02:00
eclass/cargo: Sync with Gentoo
It's from Gentoo commit 6937fcb873120179a5bb32055b26612ac4a72c52.
This commit is contained in:
parent
38a2ffe9c4
commit
bc046a6bdf
@ -448,7 +448,9 @@ _cargo_gen_git_config() {
|
||||
# Return the directory within target that contains the build, e.g.
|
||||
# target/aarch64-unknown-linux-gnu/release.
|
||||
cargo_target_dir() {
|
||||
echo "${CARGO_TARGET_DIR:-target}/$(rust_abi)/$(usex debug debug release)"
|
||||
local abi
|
||||
tc-is-cross-compiler && abi=/$(rust_abi)
|
||||
echo "${CARGO_TARGET_DIR:-target}${abi}/$(usex debug debug release)"
|
||||
}
|
||||
|
||||
# @FUNCTION: cargo_update_crates
|
||||
@ -762,6 +764,10 @@ cargo_env() {
|
||||
# locally. Do this in a subshell so that they remain set afterwards.
|
||||
unset CARGO_BUILD_RUSTFLAGS CARGO_ENCODED_RUSTFLAGS RUSTFLAGS
|
||||
|
||||
# Only tell Cargo to cross-compile when actually needed to avoid the
|
||||
# aforementioned build host vs target flag separation issue.
|
||||
tc-is-cross-compiler || unset CARGO_BUILD_TARGET
|
||||
|
||||
"${@}"
|
||||
)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user