6 stable releases

Uses old Rust 2015

1.1.2 May 30, 2017
1.1.1 Dec 28, 2016
1.1.0 Dec 26, 2016
1.0.2 Dec 25, 2016
1.0.1 Dec 15, 2016

#590 in Build Utils

Download history 5016/week @ 2023-11-20 7226/week @ 2023-11-27 5970/week @ 2023-12-04 5104/week @ 2023-12-11 5820/week @ 2023-12-18 3542/week @ 2023-12-25 5281/week @ 2024-01-01 6097/week @ 2024-01-08 5210/week @ 2024-01-15 6152/week @ 2024-01-22 7654/week @ 2024-01-29 7273/week @ 2024-02-05 8565/week @ 2024-02-12 6560/week @ 2024-02-19 6944/week @ 2024-02-26 6964/week @ 2024-03-04

29,379 downloads per month
Used in 99 crates (17 directly)

MIT/Apache

5KB
66 lines

metadeps lets you write pkg-config dependencies in Cargo.toml metadata, rather than programmatically in build.rs. This makes those dependencies declarative, so other tools can read them as well.

Usage

In your Cargo.toml, add the following to your [build-dependencies]:

metadeps = "1.1"

Then, to declare a dependency on testlib >= 1.2, and a conditional dependency on testdata >= 4.5, add the following section:

[package.metadata.pkg-config]
testlib = "1.2"
testdata = { version = "4.5", feature = "use-testdata" }

In your build.rs, add:

extern crate metadeps;

fn main() {
    metadeps::probe().unwrap();
}

lib.rs:

metadeps lets you write pkg-config dependencies in Cargo.toml metadata, rather than programmatically in build.rs. This makes those dependencies declarative, so other tools can read them as well.

metadeps parses metadata like this in Cargo.toml:

[package.metadata.pkg-config]
testlib = "1.2"
testdata = { version = "4.5", feature = "some-feature" }

Dependencies

~255KB