Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions djmaxplus/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ const COPY_TO_OUTPUT_FILES: [(&str, &str); 3] = [

fn main() -> Result<()> {
let manifest_dir = env::var("CARGO_MANIFEST_DIR")?;
let profile = env::var("PROFILE")?;
let out_dir = env::var("OUT_DIR")?;

let mut git_head = PathBuf::from(manifest_dir.clone());
git_head.pop();
git_head.push(".git");
git_head.push("HEAD");
println!("cargo:rerun-if-changed={:?}", git_head);

println!("cargo:rerun-if-changed=../.git/HEAD");
#[cfg(debug_assertions)]
{
if let Ok(output) = std::process::Command::new("git")
Expand Down Expand Up @@ -40,12 +45,13 @@ fn main() -> Result<()> {
src.push(directory);
src.push(filename);

let mut dst = PathBuf::from(manifest_dir.clone());
let mut dst = PathBuf::from(out_dir.clone());
dst.pop();
dst.pop();
dst.pop();
dst.push("target");
dst.push(&profile);
dst.push(filename);

println!("cargo:rerun-if-changed={:?}", src);
println!("copy {:?} to {:?}", src, dst);
fs::copy(src, dst)?;
}
Expand Down