Turn LTO on when cutting releases

This commit is contained in:
2025-01-14 22:25:27 -05:00
parent f1c5571aa6
commit 102aff1580
2 changed files with 11 additions and 2 deletions
+10 -2
View File
@@ -8,9 +8,17 @@ fn main() -> Result<(), Box<dyn Error>> {
}
println!("cargo::rerun-if-changed=shrooms-vb-core");
cc::Build::new()
let mut builder = cc::Build::new();
let _ = builder.try_flags_from_environment("SHROOMS_CFLAGS");
let opt_level = if builder.get_compiler().is_like_msvc() {
2
} else {
3
};
builder
.include(Path::new("shrooms-vb-core/core"))
.opt_level(2)
.opt_level(opt_level)
.flag_if_supported("-fno-strict-aliasing")
.define("VB_LITTLE_ENDIAN", None)
.define("VB_SIGNED_PROPAGATE", None)