Skip to content

Commit 9f6a65b

Browse files
committed
Update comment
1 parent 746e5c5 commit 9f6a65b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/archive.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ struct ArchiveConfig<'a> {
1212
dst: PathBuf,
1313
src: Option<PathBuf>,
1414
lib_search_paths: Vec<PathBuf>,
15-
is_like_osx: bool,
15+
use_gnu_style_archive: bool,
1616
}
1717

1818
#[derive(Debug)]
@@ -36,7 +36,8 @@ impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
3636
dst: output.to_path_buf(),
3737
src: input.map(|p| p.to_path_buf()),
3838
lib_search_paths: archive_search_paths(sess),
39-
is_like_osx: sess.target.target.options.is_like_osx, // FIXME should probably check for linux
39+
// FIXME test for linux and System V derivatives instead
40+
use_gnu_style_archive: !sess.target.target.options.is_like_osx,
4041
};
4142

4243
let (src_archives, entries) = if let Some(src) = &config.src {
@@ -128,13 +129,13 @@ impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
128129
}
129130

130131
let archive_file = File::create(&self.config.dst).unwrap();
131-
let mut builder = if self.config.is_like_osx {
132-
BuilderKind::Bsd(ar::Builder::new(archive_file))
133-
} else {
132+
let mut builder = if self.config.use_gnu_style_archive {
134133
BuilderKind::Gnu(ar::GnuBuilder::new(
135134
archive_file,
136135
self.entries.keys().map(|key| key.as_bytes().to_vec()).collect(),
137136
))
137+
} else {
138+
BuilderKind::Bsd(ar::Builder::new(archive_file))
138139
};
139140

140141
// Add all files

0 commit comments

Comments
 (0)