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
This commit is contained in:
parent
26105b1a37
commit
a1ffe6b6bb
3 changed files with 36 additions and 0 deletions
15
src/test/run-make/print-cfg/Makefile
Normal file
15
src/test/run-make/print-cfg/Makefile
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue