google / rust_icu

rust_icu: rust bindings for ICU (International Components for Unicode) library
Apache License 2.0
117 stars 28 forks source link

Link against libc++ on Apple targets #286

Closed gferon closed 1 year ago

gferon commented 1 year ago

On Apple systems, libc++ is the default C++ library^1. Trying to compile a binary example using rust_icu with the static feature enabled will currently fail on Apple systems with the following error:

  = note: ld: library 'stdc++' not found
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

This patch links against libc++ on Apple and FreeBSD systems when the static features is enabled.

Note: maybe adding a CI job that builds on macOS in static mode is also a good idea?