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.
This commit is contained in:
Andrew Kelley 2022-11-17 00:57:05 -07:00
parent 33e3db11fe
commit eef780ebf2

View File

@ -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()