From 3d88b78d200834ca81ac508566e646f0eca37c8e Mon Sep 17 00:00:00 2001 From: sideshowbarker Date: Wed, 6 Nov 2024 07:58:21 +0900 Subject: [PATCH] CMake: For Debug builds, do no compiler optimizations (-O0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- Meta/CMake/lagom_compile_options.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Meta/CMake/lagom_compile_options.cmake b/Meta/CMake/lagom_compile_options.cmake index 7fec47ac843..45c3af87493 100644 --- a/Meta/CMake/lagom_compile_options.cmake +++ b/Meta/CMake/lagom_compile_options.cmake @@ -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)