Skip to content

Commit

Permalink
fix(sys): do not link clog on android, ref #288
Browse files Browse the repository at this point in the history
  • Loading branch information
decahedron1 committed Sep 25, 2024
1 parent 89416d1 commit 2502224
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions ort-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,17 @@ fn prepare_libort_dir() -> (PathBuf, bool) {
}

add_search_dir(transform_dep(external_lib_dir.join("pytorch_cpuinfo-build"), &profile));
let clog_path = transform_dep(external_lib_dir.join("pytorch_cpuinfo-build").join("deps").join("clog"), &profile);
if clog_path.exists() {
add_search_dir(clog_path);
} else {
add_search_dir(transform_dep(external_lib_dir.join("pytorch_clog-build"), &profile));
// only android doesn't use clog, how fun!
if target_os != "android" {
let clog_path = transform_dep(external_lib_dir.join("pytorch_cpuinfo-build").join("deps").join("clog"), &profile);
if clog_path.exists() {
add_search_dir(clog_path);
} else {
add_search_dir(transform_dep(external_lib_dir.join("pytorch_clog-build"), &profile));
}
println!("cargo:rustc-link-lib=static=clog");
}
println!("cargo:rustc-link-lib=static=cpuinfo");
println!("cargo:rustc-link-lib=static=clog");

add_search_dir(transform_dep(external_lib_dir.join("re2-build"), &profile));
println!("cargo:rustc-link-lib=static=re2");
Expand Down

0 comments on commit 2502224

Please sign in to comment.