Added the --temps-dir option.
This commit is contained in:
parent
18bc4bee97
commit
5d1e09f44a
7 changed files with 49 additions and 4 deletions
|
@ -578,6 +578,7 @@ pub struct OutputFilenames {
|
|||
pub out_directory: PathBuf,
|
||||
filestem: String,
|
||||
pub single_output_file: Option<PathBuf>,
|
||||
pub temps_directory: Option<PathBuf>,
|
||||
pub outputs: OutputTypes,
|
||||
}
|
||||
|
||||
|
@ -592,12 +593,14 @@ impl OutputFilenames {
|
|||
out_directory: PathBuf,
|
||||
out_filestem: String,
|
||||
single_output_file: Option<PathBuf>,
|
||||
temps_directory: Option<PathBuf>,
|
||||
extra: String,
|
||||
outputs: OutputTypes,
|
||||
) -> Self {
|
||||
OutputFilenames {
|
||||
out_directory,
|
||||
single_output_file,
|
||||
temps_directory,
|
||||
outputs,
|
||||
filestem: format!("{}{}", out_filestem, extra),
|
||||
}
|
||||
|
@ -643,11 +646,17 @@ impl OutputFilenames {
|
|||
extension.push_str(ext);
|
||||
}
|
||||
|
||||
self.with_extension(&extension)
|
||||
let temps_directory = self.temps_directory.as_ref().unwrap_or(&self.out_directory);
|
||||
|
||||
self.with_directory_and_extension(&temps_directory, &extension)
|
||||
}
|
||||
|
||||
pub fn with_extension(&self, extension: &str) -> PathBuf {
|
||||
let mut path = self.out_directory.join(&self.filestem);
|
||||
self.with_directory_and_extension(&self.out_directory, extension)
|
||||
}
|
||||
|
||||
fn with_directory_and_extension(&self, directory: &PathBuf, extension: &str) -> PathBuf {
|
||||
let mut path = directory.join(&self.filestem);
|
||||
path.set_extension(extension);
|
||||
path
|
||||
}
|
||||
|
@ -1094,6 +1103,7 @@ pub fn rustc_short_optgroups() -> Vec<RustcOptGroup> {
|
|||
in <dir>",
|
||||
"DIR",
|
||||
),
|
||||
opt::opt_s("", "temps-dir", "Write temporary output files to <dir>", "DIR"),
|
||||
opt::opt_s(
|
||||
"",
|
||||
"explain",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue