Merge pull request #1271 from ssrlive/patch-1

Linkage issue in windows
This commit is contained in:
gwenn 2023-02-14 20:59:47 +01:00 committed by GitHub
commit 9880cdef12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,16 +181,10 @@ mod build_bundled {
cfg.include(env::var("DEP_OPENSSL_INCLUDE").unwrap());
// cargo will resolve downstream to the static lib in
// openssl-sys
} else if is_windows {
// Windows without `-vendored-openssl` takes this to link against a prebuilt
// OpenSSL lib
cfg.include(inc_dir.to_string_lossy().as_ref());
let lib = lib_dir.join("libcrypto.lib");
cfg.flag(lib.to_string_lossy().as_ref());
} else if use_openssl {
cfg.include(inc_dir.to_string_lossy().as_ref());
// branch not taken on Windows, just `crypto` is fine.
println!("cargo:rustc-link-lib=dylib=crypto");
let lib_name = if is_windows { "libcrypto" } else { "crypto" };
println!("cargo:rustc-link-lib=dylib={}", lib_name);
println!("cargo:rustc-link-search={}", lib_dir.to_string_lossy());
} else if is_apple {
cfg.flag("-DSQLCIPHER_CRYPTO_CC");