diff options
author | Geoffry Song <goffrie@dropbox.com> | 2021-04-28 14:20:37 -0700 |
---|---|---|
committer | Geoffry Song <goffrie@dropbox.com> | 2021-04-28 14:26:53 -0700 |
commit | 28f07a44ce9d0470c1f5d595c7f8cf4e621b48d8 (patch) | |
tree | 8848ebc8138d758aa8a95397422580f419128b92 /build.rs | |
parent | 50af40e2776fa3573bdf8071a3fe98cea41206da (diff) | |
download | rust-libc-28f07a44ce9d0470c1f5d595c7f8cf4e621b48d8.tar.gz |
Don't unconditionally link libiconv on macOS.
This adds `#[link(name = "iconv")]` to just the iconv symbols so that the
library is only linked if the symbols are used.
Diffstat (limited to 'build.rs')
-rw-r--r-- | build.rs | 7 |
1 files changed, 0 insertions, 7 deletions
@@ -11,7 +11,6 @@ fn main() { let align_cargo_feature = env::var("CARGO_FEATURE_ALIGN").is_ok(); let const_extern_fn_cargo_feature = env::var("CARGO_FEATURE_CONST_EXTERN_FN").is_ok(); let libc_ci = env::var("LIBC_CI").is_ok(); - let target = env::var("TARGET").unwrap(); if env::var("CARGO_FEATURE_USE_STD").is_ok() { println!( @@ -84,12 +83,6 @@ fn main() { } println!("cargo:rustc-cfg=libc_const_extern_fn"); } - - // For unknown reason, libiconv can't be linked by adding #[link(name = iconv)] to - // a macOS-specific struct, so we do the linking here. - if target.contains("-apple-") { - println!("cargo:rustc-link-lib=iconv"); - } } fn rustc_minor_nightly() -> Option<(u32, bool)> { |