Skip to content

Commit

Permalink
feat: use CARGO_BUILD_TARGET_DIR env
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
itkovian committed May 17, 2024
1 parent 332b9b8 commit cc9940d
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_BUILD_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 cc9940d

Please sign in to comment.