diff --git a/ort-sys/build.rs b/ort-sys/build.rs index 989f3554..7fb05905 100644 --- a/ort-sys/build.rs +++ b/ort-sys/build.rs @@ -160,11 +160,12 @@ fn prepare_libort_dir() -> (PathBuf, bool) { #[allow(clippy::type_complexity)] let static_configs: Vec<(PathBuf, PathBuf, PathBuf, Box PathBuf>)> = vec![ (lib_dir.join(&profile), lib_dir.join("lib"), lib_dir.join("_deps"), Box::new(|p: PathBuf, profile| p.join(profile))), + (lib_dir.join(&profile), lib_dir.join("lib"), lib_dir.join(&profile).join("_deps"), Box::new(|p: PathBuf, _| p)), (lib_dir.clone(), lib_dir.join("lib"), lib_dir.parent().unwrap().join("_deps"), Box::new(|p: PathBuf, _| p)), (lib_dir.join("onnxruntime"), lib_dir.join("onnxruntime").join("lib"), lib_dir.join("_deps"), Box::new(|p: PathBuf, _| p)), ]; for (lib_dir, extension_lib_dir, external_lib_dir, transform_dep) in static_configs { - if lib_dir.join(platform_format_lib("onnxruntime_common")).exists() { + if lib_dir.join(platform_format_lib("onnxruntime_common")).exists() && external_lib_dir.exists() { add_search_dir(&lib_dir); for lib in &["common", "flatbuffers", "framework", "graph", "mlas", "optimizer", "providers", "session", "util"] {