#build-dependencies #pkg-config

build metadeps

Run pkg-config from declarative dependencies in Cargo.toml

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

#456 in Build Utils

Download history 7537/week @ 2024-07-27 7557/week @ 2024-08-03 6916/week @ 2024-08-10 6560/week @ 2024-08-17 5765/week @ 2024-08-24 6220/week @ 2024-08-31 6091/week @ 2024-09-07 4835/week @ 2024-09-14 5798/week @ 2024-09-21 5547/week @ 2024-09-28 5322/week @ 2024-10-05 6400/week @ 2024-10-12 6457/week @ 2024-10-19 7132/week @ 2024-10-26 6845/week @ 2024-11-02 4736/week @ 2024-11-09

26,397 downloads per month
Used in 105 crates (23 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