Skip to content

Commit c602f8f

Browse files
committed
Add check for macos aarch64: not available
1 parent 44dd753 commit c602f8f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

onnxruntime-sys/build.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ fn main() {
6262
fn generate_bindings(_include_dir: &Path) {
6363
println!("Bindings not generated automatically, using committed files instead.");
6464
println!("Enable with the 'generate-bindings' cargo feature.");
65+
66+
let os = env::var("CARGO_CFG_TARGET_OS").expect("Unable to get TARGET_OS");
67+
let arch = env::var("CARGO_CFG_TARGET_ARCH").expect("Unable to get TARGET_ARCH");
68+
if os == "macos" && arch == "aarch64" {
69+
panic!(
70+
"OnnxRuntime {} bindings for Apple M1 are not available",
71+
ORT_VERSION
72+
);
73+
}
6574
}
6675

6776
#[cfg(feature = "generate-bindings")]

0 commit comments

Comments
 (0)