Skip to content

Commit e52897a

Browse files
committed
Fix libgit2-sys rerun-if-changed on Windows
1 parent 727d73f commit e52897a

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

libgit2-sys/build.rs

+3-14
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ fn main() {
205205
println!("cargo:rustc-link-lib=rpcrt4");
206206
println!("cargo:rustc-link-lib=ole32");
207207
println!("cargo:rustc-link-lib=crypt32");
208-
return;
209208
}
210209

211210
if target.contains("apple") {
@@ -214,9 +213,9 @@ fn main() {
214213
println!("cargo:rustc-link-lib=framework=CoreFoundation");
215214
}
216215

217-
rerun_if(Path::new("libgit2/include"));
218-
rerun_if(Path::new("libgit2/src"));
219-
rerun_if(Path::new("libgit2/deps"));
216+
println!("cargo:rerun-if-changed=libgit2/include");
217+
println!("cargo:rerun-if-changed=libgit2/src");
218+
println!("cargo:rerun-if-changed=libgit2/deps");
220219
}
221220

222221
fn cp_r(from: impl AsRef<Path>, to: impl AsRef<Path>) {
@@ -253,13 +252,3 @@ fn add_c_files(build: &mut cc::Build, path: impl AsRef<Path>) {
253252
}
254253
}
255254
}
256-
257-
fn rerun_if(path: &Path) {
258-
if path.is_dir() {
259-
for entry in fs::read_dir(path).expect("read_dir") {
260-
rerun_if(&entry.expect("entry").path());
261-
}
262-
} else {
263-
println!("cargo:rerun-if-changed={}", path.display());
264-
}
265-
}

0 commit comments

Comments
 (0)