only depend on vcpkg for cfg(target_env = "msvc")

This commit is contained in:
Jim McGrath 2017-05-28 06:15:47 -05:00
parent 0dd10f85ba
commit b3faed0f75
2 changed files with 5 additions and 3 deletions

View File

@ -25,4 +25,6 @@ min_sqlite_version_3_7_16 = ["pkg-config", "vcpkg"]
bindgen = { version = "0.21", optional = true }
pkg-config = { version = "0.3", optional = true }
gcc = { version = "0.3", optional = true }
[target.'cfg(target_env = "msvc")'.build-dependencies]
vcpkg = { version = "0.2", optional = true }

View File

@ -42,7 +42,7 @@ mod build {
mod build {
extern crate pkg_config;
#[cfg(feature = "vcpkg")]
#[cfg(all(feature = "vcpkg", target_env = "msvc"))]
extern crate vcpkg;
use std::env;
@ -107,7 +107,7 @@ mod build {
}
}
#[cfg(feature = "vcpkg")]
#[cfg(all(feature = "vcpkg", target_env = "msvc"))]
fn try_vcpkg() -> Option<HeaderLocation> {
// See if vcpkg can find it.
if let Ok(mut lib) = vcpkg::Config::new().probe("sqlite3") {
@ -119,7 +119,7 @@ mod build {
None
}
#[cfg(not(feature = "vcpkg"))]
#[cfg(not(all(feature = "vcpkg", target_env = "msvc")))]
fn try_vcpkg() -> Option<HeaderLocation> {
None
}