Skip to content

Commit

Permalink
2024-03-22 08:50:48
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanson committed Mar 22, 2024
1 parent 6a4c0a0 commit f8d191a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ fn main() {
fn setup_compiler_flags(build: &mut cc::Build) {
build
.static_flag(true)
.flag("-O3")
.flag("-fno-builtin-printf")
.flag("-fno-builtin-memcmp")
.flag("-nostdinc")
Expand Down Expand Up @@ -63,12 +62,12 @@ fn setup_compiler_flags(build: &mut cc::Build) {
// build.flag("-g").flag("-fno-omit-frame-pointer");
// }

// let opt_level = env::var("OPT_LEVEL").expect("fetching OPT_LEVEL");
// if opt_level == "z" {
// build.flag("-Os");
// } else {
// build.flag(&format!("-O{}", opt_level));
// }
let opt_level = env::var("OPT_LEVEL").expect("fetching OPT_LEVEL");
if opt_level == "z" {
build.flag("-Os");
} else {
build.flag(&format!("-O{}", opt_level));
}
} else if compiler.is_like_gnu() {
build
.flag("-nostartfiles")
Expand Down

0 comments on commit f8d191a

Please sign in to comment.