Skip to content

Commit

Permalink
Check for the presence of CARGO_BUILD_TARGET_DIR env variable (wez#5430)
Browse files Browse the repository at this point in the history
* feat: use CARGO_BUILD_TARGET_DIR env

When building in the presence of a CARGO_BUILD_TARGET_DIR, there is no
target dir created inside the repo, so copying to a location within the
local repo dir fails, hence we need to copy to the actual target dir
that is being used.

* fix: environment variable with correct name
  • Loading branch information
itkovian authored and saep committed Jul 14, 2024
1 parent 7f56448 commit 1545780
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion wezterm-gui/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1545780

Please sign in to comment.