Skip to content

Commit 813cdf6

Browse files
committed
Allow running vcpkg on any windows target
1 parent e33b26e commit 813cdf6

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
@@ -232,8 +232,12 @@ fn try_pkg_config() {
232232
///
233233
/// Note that if this succeeds then the function does not return as vcpkg
234234
/// should emit all of the cargo metadata that we need.
235-
#[cfg(target_env = "msvc")]
236235
fn try_vcpkg() {
236+
let target = env::var("TARGET").unwrap();
237+
if !target.contains("windows") {
238+
return;
239+
}
240+
237241
// vcpkg will not emit any metadata if it can not find libraries
238242
// appropriate for the target triple with the desired linkage.
239243

@@ -257,9 +261,6 @@ fn try_vcpkg() {
257261
process::exit(0);
258262
}
259263

260-
#[cfg(not(target_env = "msvc"))]
261-
fn try_vcpkg() {}
262-
263264
fn execute_command_and_get_output(cmd: &str, args: &[&str]) -> Option<String> {
264265
let out = Command::new(cmd).args(args).output();
265266
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)