From 7b0f50951b0d2cd89338f3ae0c7a6714946f455e Mon Sep 17 00:00:00 2001 From: Kenny Kerr Date: Thu, 18 Jan 2024 10:24:49 -0600 Subject: [PATCH] Manifests only work with MSVC --- .../samples/windows-sys/task_dialog/build.rs | 21 +++++++++++-------- crates/samples/windows/task_dialog/build.rs | 21 +++++++++++-------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/crates/samples/windows-sys/task_dialog/build.rs b/crates/samples/windows-sys/task_dialog/build.rs index 2a3e49c9a8..00f1a307ad 100644 --- a/crates/samples/windows-sys/task_dialog/build.rs +++ b/crates/samples/windows-sys/task_dialog/build.rs @@ -1,13 +1,16 @@ fn main() { - println!("cargo:rerun-if-changed=manifest.xml"); println!("cargo:rerun-if-changed=build.rs"); - println!("cargo:rustc-link-arg-bins=/MANIFEST:EMBED"); - println!( - "cargo:rustc-link-arg-bins=/MANIFESTINPUT:{}", - std::path::Path::new("manifest.xml") - .canonicalize() - .unwrap() - .display() - ); + if std::env::var("CARGO_CFG_TARGET_ENV").unwrap() == "msvc" { + println!("cargo:rerun-if-changed=manifest.xml"); + println!("cargo:rustc-link-arg-bins=/MANIFEST:EMBED"); + + println!( + "cargo:rustc-link-arg-bins=/MANIFESTINPUT:{}", + std::path::Path::new("manifest.xml") + .canonicalize() + .unwrap() + .display() + ); + } } diff --git a/crates/samples/windows/task_dialog/build.rs b/crates/samples/windows/task_dialog/build.rs index 2a3e49c9a8..00f1a307ad 100644 --- a/crates/samples/windows/task_dialog/build.rs +++ b/crates/samples/windows/task_dialog/build.rs @@ -1,13 +1,16 @@ fn main() { - println!("cargo:rerun-if-changed=manifest.xml"); println!("cargo:rerun-if-changed=build.rs"); - println!("cargo:rustc-link-arg-bins=/MANIFEST:EMBED"); - println!( - "cargo:rustc-link-arg-bins=/MANIFESTINPUT:{}", - std::path::Path::new("manifest.xml") - .canonicalize() - .unwrap() - .display() - ); + if std::env::var("CARGO_CFG_TARGET_ENV").unwrap() == "msvc" { + println!("cargo:rerun-if-changed=manifest.xml"); + println!("cargo:rustc-link-arg-bins=/MANIFEST:EMBED"); + + println!( + "cargo:rustc-link-arg-bins=/MANIFESTINPUT:{}", + std::path::Path::new("manifest.xml") + .canonicalize() + .unwrap() + .display() + ); + } }