Unverified Commit 9f294121 authored by Alex Gaynor's avatar Alex Gaynor Committed by GitHub
Browse files

Merge pull request #2187 from reaperhulk/fix-again

don't emit rerun-if-changed unless the path exists and is readable
parents 3439059e d5e6fb51
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -82,10 +82,12 @@ fn main() {
    // rerun-if-changed causes openssl-sys to rebuild if the openssl include
    // 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() {
    let potential_path = include_dir.join("openssl");
    if potential_path.exists() && !cfg!(feature = "vendored") {
        if let Some(printable_include) = potential_path.to_str() {
            println!("cargo:rerun-if-changed={}", printable_include);
        }
    }

    if !lib_dirs.iter().all(|p| p.exists()) {
        panic!("OpenSSL library directory does not exist: {:?}", lib_dirs);