diff --git a/Cargo.lock b/Cargo.lock index ebc6f37..95af004 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -212,7 +212,7 @@ dependencies = [ [[package]] name = "esaxx-rs" -version = "0.1.8" +version = "0.1.10" dependencies = [ "cc", "criterion", diff --git a/Cargo.toml b/Cargo.toml index aa16940..f610e45 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "esaxx-rs" -version = "0.1.9" +version = "0.1.10" authors = ["Nicolas Patry "] edition = "2018" description = "Wrapping around sentencepiece's esaxxx library." diff --git a/build.rs b/build.rs index 25df38b..3b0ea12 100644 --- a/build.rs +++ b/build.rs @@ -1,4 +1,5 @@ #[cfg(feature = "cpp")] +#[cfg(not(target_os = "macos"))] fn main() { cc::Build::new() .cpp(true) @@ -9,5 +10,18 @@ fn main() { .compile("esaxx"); } +#[cfg(feature = "cpp")] +#[cfg(target_os = "macos")] +fn main() { + cc::Build::new() + .cpp(true) + .flag("-std=c++11") + .flag("-stdlib=libc++") + .static_crt(true) + .file("src/esaxx.cpp") + .include("src") + .compile("esaxx"); +} + #[cfg(not(feature = "cpp"))] fn main() {}