add env VCPKG_INSTALLED_ROOT (#9985)

This commit is contained in:
KAYUII 2024-11-20 19:41:30 +08:00 committed by GitHub
parent 4a49fbe4a6
commit 608d7d55d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View File

@ -61,7 +61,11 @@ fn install_android_deps() {
let target = format!("{}-android", target_arch); let target = format!("{}-android", target_arch);
let vcpkg_root = std::env::var("VCPKG_ROOT").unwrap(); let vcpkg_root = std::env::var("VCPKG_ROOT").unwrap();
let mut path: std::path::PathBuf = vcpkg_root.into(); let mut path: std::path::PathBuf = vcpkg_root.into();
if let Ok(vcpkg_root) = std::env::var("VCPKG_INSTALLED_ROOT") {
path = vcpkg_root.into();
} else {
path.push("installed"); path.push("installed");
}
path.push(target); path.push(target);
println!( println!(
"{}", "{}",

View File

@ -55,7 +55,11 @@ fn link_vcpkg(mut path: PathBuf, name: &str) -> PathBuf {
target = target.replace("x64", "x86"); target = target.replace("x64", "x86");
} }
println!("cargo:info={}", target); println!("cargo:info={}", target);
if let Ok(vcpkg_root) = std::env::var("VCPKG_INSTALLED_ROOT") {
path = vcpkg_root.into();
} else {
path.push("installed"); path.push("installed");
}
path.push(target); path.push(target);
println!( println!(
"{}", "{}",