This overwrites the default that cmake automatically sets. In the
case of debug builds, this breaks debugging as -O1 already optimises
many variables away.
Change-Id: I3ca6965799b23d542ababc3e38880317cb46a3ac
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Message-Id: <
20231107141755.30559-1-frank@lichtenheld.com>
URL: https://www.mail-archive.com/search?l=mid&q=
20231107141755.30559-1-frank@lichtenheld.com
Signed-off-by: Gert Doering <gert@greenie.muc.de>
add_link_options("$<$<CONFIG:Release>:/CETCOMPAT>")
endif()
else ()
- set(CMAKE_C_FLAGS_RELEASE "-O2")
- set(CMAKE_CXX_FLAGS_RELEASE "-O2")
- set(CMAKE_C_FLAGS_DEBUG "-g -O1")
- set(CMAKE_CXX_FLAGS_DEBUG "-g -O1")
add_compile_options(-Wall -Wuninitialized)
check_c_compiler_flag(-Wno-stringop-truncation NoStringOpTruncation)