Craig Constable 97ca8f8468 v1.0.12
- Added support for Windows High DPI Scaling
2026-03-11 15:35:10 +10:00

28 lines
969 B
Rust

fn main() {
// Derive version from the latest Git tag (e.g. "v1.0.7" → "1.0.7").
let version = std::process::Command::new("git")
.args(["describe", "--tags", "--abbrev=0"])
.output()
.ok()
.and_then(|o| {
if o.status.success() {
String::from_utf8(o.stdout).ok()
} else {
None
}
})
.unwrap_or_else(|| String::from("0.0.0"));
let version = version.trim().trim_start_matches('v');
println!("cargo:rustc-env=APP_VERSION={version}");
// Re-run build script whenever HEAD or tags change so the version stays current.
println!("cargo:rerun-if-changed=.git/HEAD");
println!("cargo:rerun-if-changed=.git/refs/tags");
// Embed the application icon into the executable.
let mut res = winres::WindowsResource::new();
res.set_icon("src/icons/icon.ico");
res.compile().expect("Failed to compile Windows resources");
}