Skip to content

Commit

Permalink
chore: try to fix for taget os
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Nov 27, 2023
1 parent 6ad1cab commit 37af115
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -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 }
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 8 additions & 9 deletions enfer_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,24 @@ 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"

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
Expand Down

0 comments on commit 37af115

Please sign in to comment.