2022-02-07 11:42:23 +00:00
|
|
|
fn generate_pe_header() {
|
|
|
|
use time::OffsetDateTime;
|
|
|
|
|
|
|
|
let today = OffsetDateTime::now_utc();
|
|
|
|
let copyright = format!("Copyright © 2017-{} Vincent Prouillet", today.year());
|
|
|
|
let mut res = winres::WindowsResource::new();
|
|
|
|
// needed for MinGW cross-compiling
|
|
|
|
if cfg!(unix) {
|
|
|
|
res.set_windres_path("x86_64-w64-mingw32-windres");
|
|
|
|
}
|
|
|
|
res.set_icon("docs/static/favicon.ico");
|
|
|
|
res.set("LegalCopyright", ©right);
|
2022-03-03 11:35:29 +00:00
|
|
|
res.compile().expect("Failed to compile Windows resources!");
|
2022-02-07 11:42:23 +00:00
|
|
|
}
|
|
|
|
|
2017-07-15 04:24:31 +00:00
|
|
|
fn main() {
|
2022-02-07 11:42:23 +00:00
|
|
|
if std::env::var("CARGO_CFG_TARGET_OS").unwrap() != "windows"
|
|
|
|
&& std::env::var("PROFILE").unwrap() != "release"
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2022-03-03 11:35:29 +00:00
|
|
|
if cfg!(windows) {
|
2022-02-11 11:43:55 +00:00
|
|
|
generate_pe_header();
|
|
|
|
}
|
2017-07-15 04:24:31 +00:00
|
|
|
}
|