use std::fs;
use std::path::Path;
fn main() {
if cfg!(target_os = "windows") {
let mut res = winres::WindowsResource::new();
res.set_manifest_file("winrt-xaml.manifest");
res.compile().unwrap();
}
println!("cargo:rustc-link-search=native=target/debug");
println!("cargo:rustc-link-search=native=xaml_islands_helper/build/bin/Debug");
println!("cargo:rustc-link-search=native=xaml_islands_helper/build/Debug");
let dll_source = "target/debug/xaml_islands_helper.dll";
if Path::new(dll_source).exists() {
let _ = fs::create_dir_all("target/x86_64-pc-windows-msvc/debug");
let _ = fs::copy(dll_source, "target/x86_64-pc-windows-msvc/debug/xaml_islands_helper.dll");
let _ = fs::create_dir_all("target/x86_64-pc-windows-msvc/debug/examples");
let _ = fs::copy(dll_source, "target/x86_64-pc-windows-msvc/debug/examples/xaml_islands_helper.dll");
}
println!("cargo:rerun-if-changed=xaml_islands_helper/build/bin/Debug/xaml_islands_helper.dll");
println!("cargo:rerun-if-changed=target/debug/xaml_islands_helper.dll");
println!("cargo:rerun-if-changed=winrt-xaml.manifest");
}