-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
A-proc-macroArea: compiling proc-macrosArea: compiling proc-macrosC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Description
Problem
I'm writing a proc macro that generates code based on the operating system for which the library/executable is being compiled. This macro generates OS specific code for windows/linux/macos/android. Currently there is no way of finding out which operating system we are compiling for (from a proc macro).
Proposed Solution
Some way of accessing the target triplet from a proc macro.
Notes
cfg(target_os="windows")
returns true on windows even if compiling for android.
purplesyringa and tgross35
Metadata
Metadata
Assignees
Labels
A-proc-macroArea: compiling proc-macrosArea: compiling proc-macrosC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.