mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +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:
parent
1b395a3df9
commit
a0fb1478bf
Notes:
sideshowbarker
2024-07-17 05:05:51 +09:00
Author: https://github.com/SebastianZaha Commit: https://github.com/SerenityOS/serenity/commit/a0fb1478bf Pull-request: https://github.com/SerenityOS/serenity/pull/20533
2 changed files with 18 additions and 3 deletions
|
@ -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,
|
||||
|
|
|
@ -1,9 +1,17 @@
|
|||
declare_args() {
|
||||
# Build for debugging. Equivalent to is_optimized=false symbol_level=2.
|
||||
is_debug = false
|
||||
# https://clang.llvm.org/docs/UsersManual.html#controlling-debugger-tuning
|
||||
# Build with clang for debugging, tuned for a specific debugger.
|
||||
# Both imply is_debug = true.
|
||||
is_debug_lldb = false
|
||||
is_debug_gdb = false
|
||||
}
|
||||
|
||||
# args that depend on other args must live in a later declare_args() block.
|
||||
declare_args() {
|
||||
# Build for debugging. Equivalent to is_optimized=false symbol_level=2.
|
||||
is_debug = is_debug_lldb || is_debug_gdb
|
||||
}
|
||||
|
||||
declare_args() {
|
||||
# Whether to build with optimizations.
|
||||
is_optimized = !is_debug
|
||||
|
|
Loading…
Reference in a new issue