Use metadeps to specify pkg-config dependencies declaratively
This makes it easier for distribution packaging tools to generate appropriate package dependencies.
This commit is contained in:
parent
762510a5fa
commit
9ff3ce4687
|
|
@ -14,8 +14,11 @@ build = "build.rs"
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
pkg-config = "0.3"
|
metadeps = "1"
|
||||||
|
|
||||||
[target.'cfg(windows)'.dependencies]
|
[target.'cfg(windows)'.dependencies]
|
||||||
user32-sys = "0.2"
|
user32-sys = "0.2"
|
||||||
gdi32-sys = "0.2"
|
gdi32-sys = "0.2"
|
||||||
|
|
||||||
|
[package.metadata.pkg-config]
|
||||||
|
openssl = "1.0.1"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
extern crate pkg_config;
|
extern crate metadeps;
|
||||||
|
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
@ -172,8 +172,8 @@ fn try_pkg_config() {
|
||||||
// cflags dirs for showing us lots of `-I`.
|
// cflags dirs for showing us lots of `-I`.
|
||||||
env::set_var("PKG_CONFIG_ALLOW_SYSTEM_CFLAGS", "1");
|
env::set_var("PKG_CONFIG_ALLOW_SYSTEM_CFLAGS", "1");
|
||||||
|
|
||||||
let lib = match pkg_config::find_library("openssl") {
|
let lib = match metadeps::probe() {
|
||||||
Ok(lib) => lib,
|
Ok(mut libs) => libs.remove("openssl").unwrap(),
|
||||||
Err(_) => return,
|
Err(_) => return,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue