fn main() {
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
let changelog_path = std::path::Path::new(&manifest_dir)
.join("..")
.join("..")
.join("CHANGELOG.md");
let out_dir = std::env::var("OUT_DIR").unwrap();
let dest = std::path::Path::new(&out_dir).join("CHANGELOG.md");
if changelog_path.exists() {
std::fs::copy(&changelog_path, &dest).expect("Failed to copy CHANGELOG.md");
} else {
std::fs::write(&dest, "Changelog not available.").expect("Failed to write fallback");
}
println!("cargo:rerun-if-changed={}", changelog_path.display());
println!("cargo:rerun-if-changed=resources/manifest");
#[cfg(windows)]
{
let resource = std::path::Path::new("resources")
.join("manifest")
.join("arf-manifest.rc");
let _ = embed_resource::compile_for_everything(resource, embed_resource::NONE);
}
}