Skip to content

Commit

Permalink
don't emit rerun-if-changed unless the path exists and is readable
Browse files Browse the repository at this point in the history
  • Loading branch information
reaperhulk committed Feb 22, 2024
1 parent 3439059 commit 705568d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions openssl-sys/build/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,11 @@ fn main() {
// dir has changed since the last build. However, this causes a rebuild
// every time when vendoring so we disable it.
#[cfg(not(feature = "vendored"))]
if let Some(printable_include) = include_dir.join("openssl").to_str() {
println!("cargo:rerun-if-changed={}", printable_include);
let potential_path = include_dir.join("openssl");
if potential_path.exists() {
if let Some(printable_include) = potential_path.to_str() {
println!("cargo:rerun-if-changed={}", printable_include);
}
}

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

0 comments on commit 705568d

Please sign in to comment.