Don't pass -O opt level on Window targets
@@ -262,10 +262,12 @@ impl FinalBuildConfiguration {
cflags.push("-flto");
}
*/
-
+ // When targeting windows `-O` isn't supported.
+ if !target.is_windows() {
opt_level_arg = format!("-O{}", opt_level);
cflags.push(&opt_level_arg);
}
+ }
match target.as_strs() {
(_, _, "windows", Some("msvc")) if build.on_windows => {
