From 2f6c7aa5f7aba49c98210456c2cb10ed0e952dff Mon Sep 17 00:00:00 2001 From: Architector #4 <23612841+Architector4@users.noreply.github.com> Date: Wed, 5 Nov 2025 21:54:27 +0300 Subject: [PATCH] meson.build - enable debug compatible optimizations in debug modes According to `man gcc`: > Optimize debugging experience. -Og should be the optimization level of choice for the standard edit-compile-debug cycle, offering a reasonable level of optimization while maintaining fast compilation and a good debugging experience. It is a better choice than -O0 for producing debuggable code because some compiler passes that collect debug information are disabled at -O0. TLDR: it's a no-brainer to enable for debug builds. I'm running the game in debug nowadays, and using this genuinely just makes it run way faster lol --- meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meson.build b/meson.build index 62b313c7a2..a9193e32e1 100644 --- a/meson.build +++ b/meson.build @@ -68,8 +68,10 @@ if compiler.get_argument_syntax()== 'gcc' # used for gcc compatible compilers if debug_type == 'release' preprocessor_flags += ['-DRELEASE_BUILD'] # enable minimal debug features elif debug_type == 'minimal' + extra_args += ['-Og'] # debug-compatible optimizations preprocessor_flags += ['-DMIN_DEBUG_BUILD', '-DDEBUGMODE'] # enable some debug features elif debug_type == 'full' + extra_args += ['-Og'] # debug-compatible optimizations preprocessor_flags += ['-DDEBUG_BUILD', '-DDEBUGMODE'] # enable all debug features; may slow down game endif else