]> git.proxmox.com Git - cargo.git/commit
Auto merge of #2328 - alexcrichton:target-specific-deps, r=brson
authorbors <bors@rust-lang.org>
Tue, 16 Feb 2016 18:51:49 +0000 (18:51 +0000)
committerbors <bors@rust-lang.org>
Tue, 16 Feb 2016 18:51:49 +0000 (18:51 +0000)
commit4739ba1db4c31951c109873210578a32496bce0b
tree32b75c2a00fe2a78b09b5a069617a6acdcd8f416
parent3afc341ab2a6efe69eea1ecc4a9312130e20f54f
parentf5d786e05600720ba4671caf5b598624103c8f72
Auto merge of #2328 - alexcrichton:target-specific-deps, r=brson

This commit is an implementation of [RFC 1361][rfc] which is an extension of
Cargo's `target` section in `Cargo.toml` to allow the use of `#[cfg]`-like
expressions for target-specific dependencies. Now that the compiler has been
extended with `--print cfg` each invocation of Cargo will scrape this output and
learn about the relevant `#[cfg]` directives in play for the target being
compiled. Cargo will then use these directives to decide whether a dependency
should be activated or not.

This should allow definition of dependencies along the lines of:

    [target.'cfg(unix)'.dependencies]
    [target.'cfg(target_os = "linux")'.dependencies]
    [target.'cfg(windows)'.dependencies]

Which is much more ergonomic and robust than listing all the triples out!