diff --git a/wezterm-gui/build.rs b/wezterm-gui/build.rs index 7ef7b98779b..6ffb3c0853f 100644 --- a/wezterm-gui/build.rs +++ b/wezterm-gui/build.rs @@ -168,7 +168,10 @@ END .join("WezTerm.app") .join("Contents") .join("Info.plist"); - let dest_plist = repo_dir.join("target").join(profile).join("Info.plist"); + let build_target_dir = std::env::var("CARGO_TARGET_DIR") + .and_then(|s| Ok(std::path::PathBuf::from(s))) + .unwrap_or(repo_dir.join("target").join(profile)); + let dest_plist = build_target_dir.join("Info.plist"); println!("cargo:rerun-if-changed=assets/macos/WezTerm.app/Contents/Info.plist"); std::fs::copy(&src_plist, &dest_plist)