build.rs: Use cc-rs's built-in logic for warnings-as-errors.

Take a step towards supporting Clang as the compiler for -msvc targets.
This commit is contained in:
Brian Smith 2021-08-12 18:00:36 -07:00
parent 56561bc0c2
commit b21ccc97a2

@ -614,12 +614,7 @@ fn cc(
}
if warnings_are_errors {
let flag = if &target.env != "msvc" {
"-Werror"
} else {
"/WX"
};
let _ = c.flag(flag);
c.warnings_into_errors(true);
}
if is_musl {
// Some platforms enable _FORTIFY_SOURCE by default, but musl