Add build target directory to Cargo config

Anki's build scripts (ninja) set CARGO_TARGET_DIR for their own execution. But, when running cargo commands directly (like cargo check), those commands don't inherit that environment variable and use the default target/ directory instead, leading to duplicate builds.

After this change, all cargo commands (check, build, test, etc.) will use the same cache, saving storage space.
This commit is contained in:
user1823 2026-01-06 19:18:45 +05:30 committed by GitHub
parent 8f2144534b
commit 6ed9b07c41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,3 +13,6 @@ color = "always"
[target.'cfg(all(target_env = "msvc", target_os = "windows"))']
rustflags = ["-C", "target-feature=+crt-static"]
[build]
target-dir = "out/rust"