CMake: For Debug builds, do no compiler optimizations (-O0)

This change makes Debug builds use the CXX -O0 option — which tells the
compiler to build with no optimizations at all.

Otherwise, Debug builds use the -Og option — which, when trying to check
frame variables in lldb, can result in an error of this form:

> error: Couldn't look up symbols: __ZN2AK6Detail10StringBaseD2Ev
> Hint: The expression tried to call a function that is not present in
> the target, perhaps because it was optimized out by the compiler.
This commit is contained in:
sideshowbarker 2024-11-06 07:58:21 +09:00
parent f7dfe03cf6
commit 3d88b78d20
No known key found for this signature in database

View file

@ -29,7 +29,7 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
if (NOT MSVC)
add_cxx_compile_options(-ggdb3)
endif()
add_cxx_compile_options(-Og)
add_cxx_compile_options(-O0)
else()
add_cxx_compile_options(-O2)
if (NOT MSVC)