-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement cfg-based target-specific dependencies
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!
- Loading branch information
1 parent
3afc341
commit f5d786e
Showing
11 changed files
with
823 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.