-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rustc: Implement a new
--print cfg
flag
This commit is an implementation of the new compiler flags required by [RFC 1361][rfc]. This specifically adds a new `cfg` option to the `--print` flag to the compiler. This new directive will print the defined `#[cfg]` directives by the compiler for the target in question. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1361-cargo-cfg-dependencies.md
- Loading branch information
1 parent
26105b1
commit e50eac5
Showing
3 changed files
with
36 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
-include ../tools.mk | ||
|
||
all: default | ||
rustc --target x86_64-pc-windows-gnu --print cfg | grep windows | ||
rustc --target x86_64-pc-windows-gnu --print cfg | grep x86_64 | ||
rustc --target i686-pc-windows-msvc --print cfg | grep msvc | ||
rustc --target i686-apple-darwin --print cfg | grep macos | ||
|
||
ifdef IS_WINDOWS | ||
default: | ||
rustc --print cfg | grep windows | ||
else | ||
default: | ||
rustc --print cfg | grep unix | ||
endif |