Skip to content

Commit 2c7038b

Browse files
committed
Fix "Remove src_files and remove_file"
1 parent 489d2da commit 2c7038b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/archive.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
100100
Ok(())
101101
}
102102

103-
fn build(mut self) {
103+
fn build(mut self) -> bool {
104104
use std::process::Command;
105105

106106
fn add_file_using_ar(archive: &Path, file: &Path) {
@@ -133,6 +133,8 @@ impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
133133
BuilderKind::Bsd(ar::Builder::new(File::create(&self.config.dst).unwrap()))
134134
};
135135

136+
let any_members = !self.entries.is_empty();
137+
136138
// Add all files
137139
for (entry_name, entry) in self.entries.into_iter() {
138140
match entry {
@@ -193,6 +195,8 @@ impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
193195
if !status.success() {
194196
self.config.sess.fatal(&format!("Ranlib exited with code {:?}", status.code()));
195197
}
198+
199+
any_members
196200
}
197201

198202
fn inject_dll_import_lib(&mut self, _lib_name: &str, _dll_imports: &[DllImport], _tmpdir: &MaybeTempDir) {

0 commit comments

Comments
 (0)