Skip to content

cargo_bin.bbclass: Minimize calls to rust_target #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion classes/cargo_bin.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export CARGO_TARGET_DIR = "${B}"

RUST_TARGET = "${@rust_target(d, 'TARGET')}"
RUST_BUILD = "${@rust_target(d, 'BUILD')}"
CARGO_TARGET_LINKER_NAME = "${@d.getVar('RUST_TARGET', True).replace('-','_').upper()}"

# Additional flags passed directly to the "cargo build" invocation
EXTRA_CARGO_FLAGS ??= ""
Expand Down Expand Up @@ -112,7 +113,7 @@ cargo_bin_do_compile() {
export CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true"
export CARGO_UNSTABLE_HOST_CONFIG="true"
export CARGO_TARGET_APPLIES_TO_HOST="false"
export CARGO_TARGET_${@rust_target(d, 'TARGET').replace('-','_').upper()}_LINKER="${WRAPPER_DIR}/linker-wrapper.sh"
export CARGO_TARGET_${CARGO_TARGET_LINKER_NAME}_LINKER="${WRAPPER_DIR}/linker-wrapper.sh"
export CARGO_HOST_LINKER="${WRAPPER_DIR}/linker-native-wrapper.sh"
export CARGO_BUILD_FLAGS="-C rpath"
export CARGO_PROFILE_RELEASE_DEBUG="true"
Expand Down