From c5f3d48571c4039154f1801cfb53c50b04a4cbce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20F=C3=A9ron?= Date: Mon, 23 Oct 2023 10:11:38 +0200 Subject: [PATCH] Link against libc++ on Apple targets --- rust_icu_sys/src/lib.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rust_icu_sys/src/lib.rs b/rust_icu_sys/src/lib.rs index 229bde81..d4c64fc2 100644 --- a/rust_icu_sys/src/lib.rs +++ b/rust_icu_sys/src/lib.rs @@ -87,7 +87,15 @@ extern crate libc; #[cfg_attr(feature = "static", link(name = "icui18n", kind = "static"))] #[cfg_attr(feature = "static", link(name = "icuuc", kind = "static"))] #[cfg_attr(feature = "static", link(name = "icudata", kind = "static"))] -#[cfg_attr(feature = "static", link(name = "stdc++", kind = "dylib"))] +// On systems such as macOS, libc++ is the default library +#[cfg_attr( + all(target_vendor = "apple", feature = "static"), + link(name = "c++", kind = "dylib") +)] +#[cfg_attr( + not(all(target_vendor = "apple", feature = "static")), + link(name = "stdc++", kind = "dylib") +)] extern "C" {} impl From for UCharCategory {