Trying to fix stdlib issue in tokenizers.

This commit is contained in:
Nicolas Patry
2023-10-05 14:27:34 +02:00
parent cc90d0e795
commit dacdea35f1
3 changed files with 16 additions and 2 deletions

2
Cargo.lock generated
View File

@ -212,7 +212,7 @@ dependencies = [
[[package]]
name = "esaxx-rs"
version = "0.1.8"
version = "0.1.10"
dependencies = [
"cc",
"criterion",

View File

@ -1,6 +1,6 @@
[package]
name = "esaxx-rs"
version = "0.1.9"
version = "0.1.10"
authors = ["Nicolas Patry <patry.nicolas@protonmail.com>"]
edition = "2018"
description = "Wrapping around sentencepiece's esaxxx library."

View File

@ -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() {}