use embed_manifest::manifest::{ActiveCodePage, ExecutionLevel, Setting, SupportedOS};
use embed_manifest::{embed_manifest, empty_manifest};
use uv_static::EnvVars;
fn main() {
if std::env::var_os(EnvVars::CARGO_CFG_WINDOWS).is_some() {
let [major, minor, patch] = uv_version::version()
.splitn(3, '.')
.map(str::parse)
.collect::<Result<Vec<u16>, _>>()
.ok()
.and_then(|v| v.try_into().ok())
.expect("uv version must be in x.y.z format");
let manifest = empty_manifest()
.name("uv")
.version(major, minor, patch, 0)
.active_code_page(ActiveCodePage::System)
.supported_os(SupportedOS::Windows7..=SupportedOS::Windows10)
.requested_execution_level(ExecutionLevel::AsInvoker)
.long_path_aware(Setting::Enabled);
embed_manifest(manifest).expect("unable to embed manifest");
}
println!("cargo:rerun-if-changed=build.rs");
}