From 37af1155d0209d810c575902af180a58a24bfb40 Mon Sep 17 00:00:00 2001 From: Phodal Huang Date: Mon, 27 Nov 2023 15:02:36 +0800 Subject: [PATCH] chore: try to fix for taget os --- .cargo/config.toml | 6 +++--- Makefile | 3 +++ enfer_core/Cargo.toml | 17 ++++++++--------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 0c6e670..8fc887f 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,6 +1,6 @@ [alias] uniffi-bindgen = ["run", "--package", "embedded-uniffi-bindgen", "--"] -[env] -ORT_STRATEGY = { value = "system" } -ORT_LIB_LOCATION = { value = "vendor/lib" , relative = true } +#[env] +#ORT_STRATEGY = { value = "system" } +#ORT_LIB_LOCATION = { value = "vendor/lib" , relative = true } diff --git a/Makefile b/Makefile index 9a82260..7310b3d 100644 --- a/Makefile +++ b/Makefile @@ -14,4 +14,7 @@ prepare-android: rustup target add i686-linux-android bindgen-swift: + export ORT_STRATEGY=system + export ORT_LIB_LOCATION=vendor/lib cargo uniffi-bindgen generate enfer_core/src/inference.udl --language swift --out-dir examples/ios/InferenceCore/InferenceCore + export ORT_STRATEGY=download \ No newline at end of file diff --git a/enfer_core/Cargo.toml b/enfer_core/Cargo.toml index 9625a53..3dc58aa 100644 --- a/enfer_core/Cargo.toml +++ b/enfer_core/Cargo.toml @@ -30,7 +30,6 @@ ci = [] # follow https://github.com/pykeio/ort/issues/97 # default-features will use ureq -> ring library, which will cause error in macOS for cross-compiling # so we disable default-features, following: https://github.com/pykeio/ort/blob/main/Cargo.toml -ort = { version = "2.0.0-alpha.1", default-features = false, features = ["load-dynamic"] } tokenizers = { version = "0.15.0", default-features = false, features = ["progressbar", "cli", "onig", "esaxx_fast"] } ndarray = "0.15.6" @@ -38,17 +37,17 @@ uniffi = { version = "0.25" } uuid = { version = "1.5.0", features = ["v4"] } thiserror = "1.0.50" -# default-features will use ureq -> ring library, which will cause error in macOS for cross-compiling +# default-features will use ureq -> ring library, which will cause error in macOS for cross-compiling, # so we disable default-features, following: https://github.com/pykeio/ort/blob/main/Cargo.toml # all os: https://doc.rust-lang.org/reference/conditional-compilation.html#target_os -[target.'cfg(windows)'.dependencies] -ort = { version = "2.0.0-alpha.1", default-features = true } - -[target.'cfg(macos)'.dependencies] -ort = { version = "2.0.0-alpha.1", default-features = true } - -[target.'cfg(linux)'.dependencies] +[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies] ort = { version = "2.0.0-alpha.1", default-features = true } +# +#[target.'cfg(target_os = "android")'.dependencies] +#ort = { version = "2.0.0-alpha.1", default-features = false, features = ["load-dynamic"] } +# +#[target.'cfg(target_os = "ios")'.dependencies] +#ort = { version = "2.0.0-alpha.1", default-features = false, features = ["load-dynamic"] } [package.metadata] ignore-bin = true