From 495f7d4f72344c4dab3e99be51437329b111ebc8 Mon Sep 17 00:00:00 2001 From: lingyaochu Date: Thu, 12 Mar 2026 21:56:03 +0800 Subject: [PATCH] skip embedding Windows resources when built as a library --- crates/pet/build.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/pet/build.rs b/crates/pet/build.rs index f259621f..240d2fca 100644 --- a/crates/pet/build.rs +++ b/crates/pet/build.rs @@ -4,6 +4,9 @@ fn main() { #[cfg(target_os = "windows")] { + if std::env::var("CARGO_BIN_NAME").is_err() { + return; + } let version = std::env::var("CARGO_PKG_VERSION").unwrap_or_else(|_| "0.1.0".to_string()); let mut res = winresource::WindowsResource::new();