Description
Problem
It is really nice that Cargo supports compiling for multiple platform target triples (not to be confused with the artifacts that Cargo produces). However, it is inconvenient that this capability does not extend to CARGO_BUILD_TARGET
.
Proposed Solution
Make CARGO_BUILD_TARGET
take multiple values, potentially comma-separated, such that CARGO_BUILD_TARGET=aarch64-apple-darwin,aarch64-apple-ios cargo build
would work the same as cargo build --target aarch64-apple-darwin --target aarch64-apple-ios
.
Perhaps we could even extend --target
to allow comma-separated target triples too?
As a bit of prior art, x.py
in rust-lang/rust supports comma-separated target triples.
Notes
This wouldn't work with custom target triple paths that contain commas. How common are these? And would it be okay to break, since custom target json specs are unstable anyhow?
This was also discussed in #10473, but nothing further was done about this yet (from my understanding?)