Skip to content

Commit 282e305

Browse files
committed
Only run ranlib when necessary
1 parent daad966 commit 282e305

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/archive.rs

+10-8
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,16 @@ impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
220220
// Finalize archive
221221
std::mem::drop(builder);
222222

223-
// Run ranlib to be able to link the archive
224-
let status = std::process::Command::new("ranlib")
225-
.arg(self.config.dst)
226-
.status()
227-
.expect("Couldn't run ranlib");
228-
229-
if !status.success() {
230-
self.config.sess.fatal(&format!("Ranlib exited with code {:?}", status.code()));
223+
if self.update_symbols {
224+
// Run ranlib to be able to link the archive
225+
let status = std::process::Command::new("ranlib")
226+
.arg(self.config.dst)
227+
.status()
228+
.expect("Couldn't run ranlib");
229+
230+
if !status.success() {
231+
self.config.sess.fatal(&format!("Ranlib exited with code {:?}", status.code()));
232+
}
231233
}
232234
}
233235
}

0 commit comments

Comments
 (0)