Closed
Description
[cfg_attr] is a theoretical tag for conditional use of an attribute based on target.
For example:
#[cfg_attr(target_os="macos", foo, bar(a, b), ...)]
#[cfg_attr(target_os="linux", baz(c, d), qux, ...)]
On OS X this expands to
#[foo]
#[bar(a,b)]
On Linux is expands to
#[baz(c,d)]
#[bar]
This would probably be eventually replaced by a more powerful meta-item system. I'm thinking along the lines of cmake?