diff --git a/build.rs b/build.rs index 7333fff7b..3d19ee037 100644 --- a/build.rs +++ b/build.rs @@ -61,7 +61,11 @@ fn install_android_deps() { let target = format!("{}-android", target_arch); let vcpkg_root = std::env::var("VCPKG_ROOT").unwrap(); let mut path: std::path::PathBuf = vcpkg_root.into(); - path.push("installed"); + if let Ok(vcpkg_root) = std::env::var("VCPKG_INSTALLED_ROOT") { + path = vcpkg_root.into(); + } else { + path.push("installed"); + } path.push(target); println!( "{}", diff --git a/libs/scrap/build.rs b/libs/scrap/build.rs index 55a688633..0c0cd274e 100644 --- a/libs/scrap/build.rs +++ b/libs/scrap/build.rs @@ -55,7 +55,11 @@ fn link_vcpkg(mut path: PathBuf, name: &str) -> PathBuf { target = target.replace("x64", "x86"); } println!("cargo:info={}", target); - path.push("installed"); + if let Ok(vcpkg_root) = std::env::var("VCPKG_INSTALLED_ROOT") { + path = vcpkg_root.into(); + } else { + path.push("installed"); + } path.push(target); println!( "{}",