Skip to content

Commit 033c896

Browse files
Lance Heplerbrainstorm
andauthored
restrict rerun-if-changed to build files (#203)
especially to ignore the .git directory Co-authored-by: Roman Valls Guimera <brainstorm@users.noreply.github.com>
1 parent 910c295 commit 033c896

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

hts-sys/build.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,14 @@ fn main() {
112112
println!("cargo:rustc-link-lib=static=hts");
113113
println!("cargo:rerun-if-changed=wrapper.c");
114114
println!("cargo:rerun-if-changed=wrapper.h");
115-
for htsfile in glob("htslib/**/*").unwrap() {
116-
let htsfile = htsfile.as_ref().unwrap().to_str().unwrap();
117-
println!("cargo:rerun-if-changed={}", htsfile);
115+
println!("cargo:rerun-if-changed=htslib/Makefile");
116+
let globs = std::iter::empty()
117+
.chain(glob("htslib/*.[ch]").unwrap())
118+
.chain(glob("htslib/cram/*.[ch]").unwrap())
119+
.chain(glob("htslib/htslib/*.h").unwrap())
120+
.chain(glob("htslib/os/*.[ch]").unwrap())
121+
.filter_map(Result::ok);
122+
for htsfile in globs {
123+
println!("cargo:rerun-if-changed={}", htsfile.display());
118124
}
119125
}

0 commit comments

Comments
 (0)