I was wondering if it's possible to tell rust to always use the pattern
target/<triple> as its output directory rather than a mix of
target/<triple> for the output directory.
Bonus points if I don't have to create target configs for each triple that would be built.
There's no option for that. However, you could always pass
--target arg, even when compiling natively.
@kornel , thank you for confirming. I was going to do that via a
Makefile but I was wondering there was a way to use native
Yeah, it's annoying that there be no alias à la
cargo build --target host.
I thus usually end up writing something along the lines of:
cargo build --target "$(rustc -vV | sed -nE 's/host: (.*)/\1/p')"
to "host-compile". Do note that this may also affect whether the
RUSTFLAGS are passed to
build.rs scripts and procedural macro crates.