Skip to content

Commit 9e61a22

Browse files
authored
Only embed Windows resources for binary targets (#374)
Closes #373 Ensures winresource only runs when building binary targets by checking the `CARGO_BIN_NAME` environment variable. This prevents resource conflicts when pet is used as a library dependency on Windows.
1 parent 72123ab commit 9e61a22

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crates/pet/build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
fn main() {
55
#[cfg(target_os = "windows")]
66
{
7+
if std::env::var("CARGO_BIN_NAME").is_err() {
8+
return;
9+
}
710
let version = std::env::var("CARGO_PKG_VERSION").unwrap_or_else(|_| "0.1.0".to_string());
811

912
let mut res = winresource::WindowsResource::new();

0 commit comments

Comments
 (0)