From eef780ebf2299181ec182470aa057d77a065ff13 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 17 Nov 2022 00:57:05 -0700 Subject: [PATCH] CMake: use -O1 instead of -O2 for building generated .c code Idea here is that this is a sweet spot of not wasting time waiting for optimizations but also getting decent runime performance. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 935b39da80..f8b2426984 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -713,8 +713,8 @@ if(MSVC) set(ZIG2_COMPILE_FLAGS "/std:c99") set(ZIG2_LINK_FLAGS "/STACK:16777216") else() - set(ZIG1_COMPILE_FLAGS "-std=c99 -O2 -march=native") - set(ZIG2_COMPILE_FLAGS "-std=c99 -O2 -march=native") + set(ZIG1_COMPILE_FLAGS "-std=c99 -O1 -march=native") + set(ZIG2_COMPILE_FLAGS "-std=c99 -O1 -march=native") set(ZIG2_LINK_FLAGS "-Wl,-z,stack-size=0x10000000") endif()