Add dedicated target_dir field to CargoConfig and FlycheckConfig

Add dedicated field for `target_dir` in the configurations for Cargo
and Flycheck. Also change the directory to be a `PathBuf` as opposed to
a `String` to be more appropriate to the operating system.
This commit is contained in:
Victor Song 2023-09-30 21:02:12 -05:00
parent aeef7b644b
commit 53b6700594
4 changed files with 54 additions and 68 deletions

View file

@ -73,6 +73,10 @@ impl WorkspaceBuildScripts {
cmd.args(["check", "--quiet", "--workspace", "--message-format=json"]);
cmd.args(&config.extra_args);
if let Some(target_dir) = &config.target_dir {
cmd.arg("--target-dir").arg(target_dir);
}
// --all-targets includes tests, benches and examples in addition to the
// default lib and bins. This is an independent concept from the --target
// flag below.