Don't manually specify optimization flags for MSVC (cc-rs takes care)
I agree to license my contributions to each file under the terms given at the top of each file I changed.
This commit is contained in:
parent
e7aedb26c6
commit
08413016bf
11
build.rs
11
build.rs
@ -611,14 +611,9 @@ fn configure_cc(c: &mut cc::Build, target: &Target, include_dir: &Path) {
|
||||
let _ = c.define("NDEBUG", None);
|
||||
}
|
||||
|
||||
if compiler.is_like_msvc() {
|
||||
if std::env::var("OPT_LEVEL").unwrap() == "0" {
|
||||
let _ = c.flag("/Od"); // Disable optimization for debug builds.
|
||||
// run-time checking: (s)tack frame, (u)ninitialized variables
|
||||
let _ = c.flag("/RTCsu");
|
||||
} else {
|
||||
let _ = c.flag("/Ox"); // Enable full optimization.
|
||||
}
|
||||
if compiler.is_like_msvc() && std::env::var("OPT_LEVEL").unwrap() == "0" {
|
||||
// run-time checking: (s)tack frame, (u)ninitialized variables
|
||||
let _ = c.flag("/RTCsu");
|
||||
}
|
||||
|
||||
// Allow cross-compiling without a target sysroot for these targets.
|
||||
|
Loading…
x
Reference in New Issue
Block a user