summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rust/rust-cross.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/rust/rust-cross.inc')
-rw-r--r--meta/recipes-devtools/rust/rust-cross.inc16
1 files changed, 4 insertions, 12 deletions
diff --git a/meta/recipes-devtools/rust/rust-cross.inc b/meta/recipes-devtools/rust/rust-cross.inc
index 4c026b1f38..2e47a3aa5f 100644
--- a/meta/recipes-devtools/rust/rust-cross.inc
+++ b/meta/recipes-devtools/rust/rust-cross.inc
@@ -1,17 +1,9 @@
python do_rust_gen_targets () {
wd = d.getVar('WORKDIR') + '/targets/'
- # It is important 'TARGET' is last here so that it overrides our less
- # informed choices for BUILD & HOST if TARGET happens to be the same as
- # either of them.
- for thing in ['BUILD', 'HOST', 'TARGET']:
- bb.debug(1, "rust_gen_target for " + thing)
- features = ""
- cpu = "generic"
- arch = d.getVar('{}_ARCH'.format(thing))
- if thing is "TARGET":
- features = d.getVar('TARGET_LLVM_FEATURES') or ""
- cpu = d.getVar('TARGET_LLVM_CPU')
- rust_gen_target(d, thing, wd, features, cpu, arch)
+ # Order of BUILD, HOST, TARGET is important in case the files overwrite, most specific last
+ rust_gen_target(d, 'BUILD', wd, "", "generic", d.getVar('BUILD_ARCH'))
+ rust_gen_target(d, 'HOST', wd, "", "generic", d.getVar('HOST_ARCH'))
+ rust_gen_target(d, 'TARGET', wd, d.getVar('TARGET_LLVM_FEATURES') or "", d.getVar('TARGET_LLVM_CPU'), d.getVar('TARGET_ARCH'))
}
# Otherwise we'll depend on what we provide