60 lines
1.5 KiB
Plaintext
60 lines
1.5 KiB
Plaintext
/*
|
|
* advotracker - Hotline tackingtool for Advocats
|
|
*
|
|
* Copyright 2021 Ralf Zerres <ralf.zerres@networkx.de>
|
|
* SPDX-License-Identifier: (0BSD or MIT)
|
|
*/
|
|
|
|
use cfg_if::cfg_if;
|
|
use std::error::Error;
|
|
use twine::build_translations;
|
|
#[cfg(target_os="windows")]
|
|
use winres::{VersionInfo, WindowsResource};
|
|
#[cfg(target_os="windows")]
|
|
use winapi;
|
|
|
|
//cfg_if! {
|
|
// if #[cfg(windows)] {
|
|
fn set_winres() -> Result<(), Box<dyn Error>> {
|
|
println!("cargo: build windows resources");
|
|
cfg!(target_env="gnu");
|
|
let mut res = WindowsResource::new();
|
|
//res.set_icon("assets/icons/advotracker/advotracker.ico")
|
|
res.set_icon("icon.ico")
|
|
// needs winapi feature "winnt"
|
|
.set_language(
|
|
winapi::um::winnt::MAKELANGID(
|
|
winapi::um::winnt::LANG_GERMAN
|
|
)
|
|
// winapi::um::winnt::MAKELANGID(
|
|
// winapi::um::winnt::LANG_ENGLISH,
|
|
// winapi::um::winnt::SUBLANG_ENGLISH_US
|
|
);
|
|
//res.set_icon("advotracker.ico")
|
|
//res.set("InternalName", "ADVOTRACKER.EXE")
|
|
// manually set version 0.1.8.0
|
|
//.set_version_info(VersionInfo::PRODUCTVERSION, 0x0000000100080000);
|
|
res.compile()?;
|
|
|
|
Ok(())
|
|
}
|
|
// }
|
|
//}
|
|
|
|
fn main() -> Result<(), Box<dyn Error>> {
|
|
println!("cargo: rerun-if-changed=build.rs");
|
|
build_translations(&["./src/i18n/localization.ini"], "i18n.rs").unwrap();
|
|
|
|
println!("Target-OS: windows!");
|
|
set_winres()?;
|
|
|
|
// cfg_if! {
|
|
// if #[cfg(windows)] {
|
|
// println!("Target-OS: windows!");
|
|
// set_winres()?;
|
|
// }
|
|
// }
|
|
|
|
Ok(())
|
|
}
|