Skip to content
Run pkg-config from declarative dependencies in Cargo.toml
Branch: master
Clone or download
joshtriplett Cargo.toml: Remove documentation key
crates.io now defaults to docs.rs (and uses https), so don't specify it.
Latest commit c8cc596 Feb 6, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Support conditional dependencies based on cargo features Dec 26, 2016
tests
.gitignore
Cargo.toml
README.md

README.md

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();
}
You can’t perform that action at this time.