mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
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:
parent
aeef7b644b
commit
53b6700594
4 changed files with 54 additions and 68 deletions
|
@ -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.
|
||||
|
|
|
@ -96,6 +96,8 @@ pub struct CargoConfig {
|
|||
pub extra_env: FxHashMap<String, String>,
|
||||
pub invocation_strategy: InvocationStrategy,
|
||||
pub invocation_location: InvocationLocation,
|
||||
/// Optional path to use instead of `target` when building
|
||||
pub target_dir: Option<PathBuf>,
|
||||
}
|
||||
|
||||
pub type Package = Idx<PackageData>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue