1#![allow(clippy::disallowed_methods, reason = "build scripts are exempt")]
2
3fn main() {
4 println!("cargo::rustc-check-cfg=cfg(gles)");
5
6 let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
7
8 if target_os == "windows" {
9 #[cfg(feature = "windows-manifest")]
10 embed_resource();
11 }
12}
13
14#[cfg(feature = "windows-manifest")]
15fn embed_resource() {
16 let manifest = std::path::Path::new("resources/windows/gpui.manifest.xml");
17 let rc_file = std::path::Path::new("resources/windows/gpui.rc");
18 println!("cargo:rerun-if-changed={}", manifest.display());
19 println!("cargo:rerun-if-changed={}", rc_file.display());
20 embed_resource::compile(rc_file, embed_resource::NONE)
21 .manifest_required()
22 .unwrap();
23}