Passing rustflags for only target-specific release builsd


#1

My app doesn’t need a console window for Windows in release builds (as it’s helpful when debugging so I want it on for debug builds), which means I need to set the rustflags “-C -mwindows”. Is there a way to do this specifically like this, selecting both a target and a profile?

This discussion was brought up in [Solved] Rust project how build like gcc -mwindow?, but mine is more specific so I didn’t want to disturb that one.

Basically what I’d like to do is something like:

[profile.release]
[target.'cfg(windows)']
rustflags = ["-C", "-mwindows"]

I’ve been using Appveyor to do my Windows builds as I don’t have easy access to a Windows machine, so I was hoping to get a definitive answer before I just send my CI script to the AppVeyor gods to see what they respond with.