From 03b8b29e4c638ea05415520aff6a3a75f1200ad7 Mon Sep 17 00:00:00 2001 From: Jim McGrath Date: Tue, 25 Feb 2020 23:56:49 -0600 Subject: [PATCH] use library names supplied by vcpkg --- openssl-sys/CHANGELOG.md | 4 ++++ openssl-sys/Cargo.toml | 2 +- openssl-sys/build/find_normal.rs | 21 +++------------------ 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/openssl-sys/CHANGELOG.md b/openssl-sys/CHANGELOG.md index 0ebc362a9..6ba2c1c68 100644 --- a/openssl-sys/CHANGELOG.md +++ b/openssl-sys/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Fixed + +* Fixed windows-msvc library names when using OpenSSL from vcpkg. + ## [v0.9.54] - 2020-01-29 ### Added diff --git a/openssl-sys/Cargo.toml b/openssl-sys/Cargo.toml index 95dc2617a..a85e46c01 100644 --- a/openssl-sys/Cargo.toml +++ b/openssl-sys/Cargo.toml @@ -24,7 +24,7 @@ pkg-config = "0.3.9" autocfg = "1.0" [target.'cfg(target_env = "msvc")'.build-dependencies] -vcpkg = "0.2" +vcpkg = "0.2.8" # We don't actually use metadeps for annoying reasons but this is still here for tooling [package.metadata.pkg-config] diff --git a/openssl-sys/build/find_normal.rs b/openssl-sys/build/find_normal.rs index 4338fcefa..896d39543 100644 --- a/openssl-sys/build/find_normal.rs +++ b/openssl-sys/build/find_normal.rs @@ -194,31 +194,16 @@ fn try_pkg_config() { /// should emit all of the cargo metadata that we need. #[cfg(target_env = "msvc")] fn try_vcpkg() { - use vcpkg; - // vcpkg will not emit any metadata if it can not find libraries // appropriate for the target triple with the desired linkage. - let mut lib = vcpkg::Config::new() + let lib = vcpkg::Config::new() .emit_includes(true) - .lib_name("libcrypto") - .lib_name("libssl") - .probe("openssl"); + .find_package("openssl"); if let Err(e) = lib { println!( - "note: vcpkg did not find openssl as libcrypto and libssl: {}", - e - ); - lib = vcpkg::Config::new() - .emit_includes(true) - .lib_name("libeay32") - .lib_name("ssleay32") - .probe("openssl"); - } - if let Err(e) = lib { - println!( - "note: vcpkg did not find openssl as ssleay32 and libeay32: {}", + "note: vcpkg did not find openssl: {}", e ); return; -- GitLab