1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 09:57:36 +00:00

Meta: Add options for lldb and gdb output to gn

This makes it possible to specify (instead of is_debug) a more
specialized is_debug_lldb or is_debug_gdb, so that clang outputs the
proper symbols. (For lldb this fixes issues with formatting by
setting -fstandalone-debug)
This commit is contained in:
Sebastian Zaha 2023-08-12 22:46:22 +02:00 committed by Andrew Kaster
parent 1b395a3df9
commit a0fb1478bf
2 changed files with 18 additions and 3 deletions

View file

@ -24,7 +24,14 @@ config("compiler_defaults") {
ldflags = []
if (symbol_level == 2) {
cflags += [ "-g" ]
if (is_debug_gdb) {
cflags += [ "-ggdb" ]
} else if (is_clang && is_debug_lldb) {
# GCC (as of version 13) does not support lldb-specific debug information
cflags += [ "-glldb" ]
} else {
cflags += [ "-g" ]
}
# For full debug-info -g builds, --gdb-index makes links ~15% slower, and
# gdb symbol reading time 1500% faster (lld links in 4.4 instead of 3.9s,