/* * advotracker - Hotline tackingtool for Advocats * * Copyright 2021 Ralf Zerres * SPDX-License-Identifier: (0BSD or MIT) */ use std::env; use std::error::Error; #[cfg(target_os = "windows")] use windres::Build; fn main() -> Result<(), Box> { if env::var("CARGO_CFG_TARGET_FAMILY")? == "windows" { let mut res = Build::new(); let target_env = std::env::var("CARGO_CFG_TARGET_ENV")?; match target_env.as_str() { "gnu" => res.set_icon("advotracker.rc"), "msvc" => res.set_icon("advotracker.rc"), _ => panic!("Unsupported env: {}", target_env), }; res.compile()? } }