-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add some hints to the docs for cfg()
targets
#6990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -461,6 +461,19 @@ 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). | ||
|
||
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`. | ||
If you want to know which cfg targets are used by the release profile, | ||
add the `-O` parameter. | ||
|
||
This same set of values is used throughout the build for all crates in your project, | ||
|
||
so, 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](manifest.md#the-features-section) instead. | ||
|
||
In addition to `#[cfg]` syntax, Cargo also supports listing out the full target | ||
the dependencies would apply to: | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.