-
Notifications
You must be signed in to change notification settings - Fork 389
/
Copy pathbuild.rs
25 lines (23 loc) · 876 Bytes
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#[cfg(windows)]
fn make_lang_id(p: u16, s: u16) -> u16 {
(s << 10) | p
}
fn main() {
#[cfg(windows)]
{
let mut res = winres::WindowsResource::new();
res.set("ProductVersion", mullvad_version::VERSION);
res.set_icon("../dist-assets/icon.ico");
res.set_language(make_lang_id(
windows_sys::Win32::System::SystemServices::LANG_ENGLISH as u16,
windows_sys::Win32::System::SystemServices::SUBLANG_ENGLISH_US as u16,
));
res.compile().expect("Unable to generate windows resources");
}
let target_os = std::env::var("CARGO_CFG_TARGET_OS").expect("CARGO_CFG_TARGET_OS not set");
// Enable DAITA by default on desktop
println!("cargo::rustc-check-cfg=cfg(daita)");
if let "linux" | "windows" | "macos" = target_os.as_str() {
println!(r#"cargo::rustc-cfg=daita"#);
}
}