Skip to content

Commit

Permalink
Auto merge of #6990 - notriddle:patch-1, r=ehuss
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed May 28, 2019
2 parents a7648c7 + 69f9adb commit 9be4594
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/doc/src/reference/specifying-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,8 @@ Cargo how to find local unpublished crates.


Platform-specific dependencies take the same format, but are listed under a
`target` section. Normally Rust-like `#[cfg]` syntax will be used to define
`target` section. Normally Rust-like [`#[cfg]`
syntax](../reference/conditional-compilation.html) will be used to define
these sections:

```toml
Expand All @@ -458,8 +459,18 @@ native = { path = "native/x86_64" }
```

Like with Rust, the syntax here supports the `not`, `any`, and `all` operators
to combine various cfg name/value pairs. Note that the `cfg` syntax has only
been available since Cargo 0.9.0 (Rust 1.8.0).
to combine various cfg name/value pairs.

If you want to know which cfg targets are available on your platform, run
`rustc --print=cfg` from the command line. If you want to know which `cfg`
targets are available for another platform, such as 64-bit Windows,
run `rustc --print=cfg --target=x86_64-pc-windows-msvc`.

Unlike in your Rust source code,
you cannot use `[target.'cfg(feature = "my_crate")'.dependencies]` to add
dependencies based on optional crate features.
Use [the `[features]` section](reference/manifest.html#the-features-section)
instead.

In addition to `#[cfg]` syntax, Cargo also supports listing out the full target
the dependencies would apply to:
Expand Down

0 comments on commit 9be4594

Please sign in to comment.