I have a Rust program that I want to compile for the \"windows\" subsystem when I\'m building it for distribution. Currently I am using this in my main.rs:
#![fe
As described in The Rust Programming Language, specifically the chapter on conditional compilation:
You can also set another attribute based on a
cfg
variable withcfg_attr
:#[cfg_attr(a, b)]
Will be the same as
#[b]
ifa
is set bycfg
attribute, and nothing otherwise.
In this case, it should be something like
#![cfg_attr(my_feature_name_i_made_up, windows_subsystem = "windows")]