Skip to content

Commit 50787ed

Browse files
authored
Merge pull request #1982 from micolous/vcpkg
Allow running vcpkg on any Windows target
2 parents 3cee797 + 813cdf6 commit 50787ed

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

openssl-sys/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ bindgen = { version = "0.64.0", optional = true, features = ["experimental"] }
2727
cc = "1.0.61"
2828
openssl-src = { version = "111", optional = true }
2929
pkg-config = "0.3.9"
30-
31-
[target.'cfg(target_env = "msvc")'.build-dependencies]
3230
vcpkg = "0.2.8"
3331

3432
# We don't actually use metadeps for annoying reasons but this is still here for tooling

openssl-sys/build/find_normal.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,12 @@ fn try_pkg_config() {
230230
///
231231
/// Note that if this succeeds then the function does not return as vcpkg
232232
/// should emit all of the cargo metadata that we need.
233-
#[cfg(target_env = "msvc")]
234233
fn try_vcpkg() {
234+
let target = env::var("TARGET").unwrap();
235+
if !target.contains("windows") {
236+
return;
237+
}
238+
235239
// vcpkg will not emit any metadata if it can not find libraries
236240
// appropriate for the target triple with the desired linkage.
237241

@@ -255,9 +259,6 @@ fn try_vcpkg() {
255259
process::exit(0);
256260
}
257261

258-
#[cfg(not(target_env = "msvc"))]
259-
fn try_vcpkg() {}
260-
261262
fn execute_command_and_get_output(cmd: &str, args: &[&str]) -> Option<String> {
262263
let out = Command::new(cmd).args(args).output();
263264
if let Ok(ref r1) = out {

openssl-sys/build/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ extern crate cc;
44
#[cfg(feature = "vendored")]
55
extern crate openssl_src;
66
extern crate pkg_config;
7-
#[cfg(target_env = "msvc")]
87
extern crate vcpkg;
98

109
use std::collections::HashSet;

0 commit comments

Comments
 (0)