blob: 8f0e65e09b86cb2146d0508fe7147788ae2d7be1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
Fix the output path for Rust binaries in the Ninja file to match
Cargo's target directory when CARGO_BUILD_TARGET is set. This prevents
file-not-found errors for some build steps.
From: Lucio Sauer <watermanpaint@posteo.net>
--- a/build/ninja_gen/src/cargo.rs
+++ b/build/ninja_gen/src/cargo.rs
@@ -61,6 +61,9 @@ impl RustOutput<'_> {
let mut path: Utf8PathBuf = rust_base.into();
if let Some(target) = target {
path = path.join(target);
+ } else {
+ let triple = std::env::var("CARGO_BUILD_TARGET").unwrap_or_default();
+ path = path.join(triple);
}
path = path.join(profile_output_dir(build_profile)).join(filename);
path.to_string()
|