From 1756d0fbd3784f50182fea20f02a7d3d10e7bc6f Mon Sep 17 00:00:00 2001 From: patr0nus Date: Tue, 11 May 2021 19:51:51 +0800 Subject: [PATCH] Add back opt_level --- libquickjs-sys/build.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libquickjs-sys/build.rs b/libquickjs-sys/build.rs index 450edb2..8f2bb37 100644 --- a/libquickjs-sys/build.rs +++ b/libquickjs-sys/build.rs @@ -90,5 +90,10 @@ fn main() { .flag_if_supported("-Wno-cast-function-type") .flag_if_supported("-Wno-implicit-fallthrough") .flag_if_supported("-Wno-enum-conversion") + // cc uses the OPT_LEVEL env var by default, but we hardcode it to -O2 + // since release builds use -O3 which might be problematic for quickjs, + // and debug builds only happen once anyway so the optimization slowdown + // is fine. + .opt_level(2) .compile(LIB_NAME); }