Skip to content

Commit 8a045af

Browse files
committed
Don't link against iconv on apple targets when used by std
1 parent 2dfe1ab commit 8a045af

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: src/unix/bsd/apple/mod.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -5873,7 +5873,10 @@ cfg_if! {
58735873
}
58745874
}
58755875

5876-
#[link(name = "iconv")]
5876+
// These require a dependency on `libiconv`, and including this when built as
5877+
// part of `std` means every Rust program gets it. Ideally we would have a link
5878+
// modifier to only include these if they are used, but we do not.
5879+
#[cfg_attr(not(feature = "rustc-dep-of-std"), link(name = "iconv"))]
58775880
extern "C" {
58785881
pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t;
58795882
pub fn iconv(

0 commit comments

Comments
 (0)