Move temp file name generation out of the create_dll_import_lib method
This commit is contained in:
parent
ba5ff07532
commit
ee89db9b17
5 changed files with 19 additions and 24 deletions
|
@ -31,9 +31,8 @@ pub trait ArchiveBuilderBuilder {
|
|||
sess: &Session,
|
||||
lib_name: &str,
|
||||
dll_imports: &[DllImport],
|
||||
tmpdir: &Path,
|
||||
is_direct_dependency: bool,
|
||||
) -> PathBuf;
|
||||
output_path: &Path,
|
||||
);
|
||||
|
||||
fn extract_bundled_libs<'a>(
|
||||
&'a self,
|
||||
|
|
|
@ -494,13 +494,17 @@ fn create_dll_import_libs<'a>(
|
|||
Ok(collate_raw_dylibs(sess, used_libraries)?
|
||||
.into_iter()
|
||||
.map(|(raw_dylib_name, raw_dylib_imports)| {
|
||||
let name_suffix = if is_direct_dependency { "_imports" } else { "_imports_indirect" };
|
||||
let output_path = tmpdir.join(format!("{raw_dylib_name}{name_suffix}.lib"));
|
||||
|
||||
archive_builder_builder.create_dll_import_lib(
|
||||
sess,
|
||||
&raw_dylib_name,
|
||||
&raw_dylib_imports,
|
||||
tmpdir,
|
||||
is_direct_dependency,
|
||||
)
|
||||
&output_path,
|
||||
);
|
||||
|
||||
output_path
|
||||
})
|
||||
.collect())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue