Skip to content

Commit 705568d

Browse files
committed
don't emit rerun-if-changed unless the path exists and is readable
1 parent 3439059 commit 705568d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

openssl-sys/build/main.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,11 @@ fn main() {
8383
// dir has changed since the last build. However, this causes a rebuild
8484
// every time when vendoring so we disable it.
8585
#[cfg(not(feature = "vendored"))]
86-
if let Some(printable_include) = include_dir.join("openssl").to_str() {
87-
println!("cargo:rerun-if-changed={}", printable_include);
86+
let potential_path = include_dir.join("openssl");
87+
if potential_path.exists() {
88+
if let Some(printable_include) = potential_path.to_str() {
89+
println!("cargo:rerun-if-changed={}", printable_include);
90+
}
8891
}
8992

9093
if !lib_dirs.iter().all(|p| p.exists()) {

0 commit comments

Comments
 (0)