mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
[gn build] Add symbol_level to adjust debug info level
is_debug by default makes symbol_level = 2 and !is_debug means by default symbol_level = 0. Reviewed By: thakis Differential Revision: https://reviews.llvm.org/D92958
This commit is contained in:
parent
803a9c9668
commit
3dc6698f98
@ -72,9 +72,13 @@ config("compiler_defaults") {
|
||||
ldflags += [ "-mmacosx-version-min=10.10" ]
|
||||
}
|
||||
|
||||
assert(symbol_level == 0 || symbol_level == 1 || symbol_level == 2,
|
||||
"Unexpected symbol_level")
|
||||
if (host_os != "win") {
|
||||
if (is_debug) {
|
||||
if (symbol_level == 2) {
|
||||
cflags += [ "-g" ]
|
||||
} else if (symbol_level == 1) {
|
||||
cflags += [ "-g1" ]
|
||||
}
|
||||
if (is_optimized) {
|
||||
cflags += [ "-O3" ]
|
||||
@ -88,11 +92,14 @@ config("compiler_defaults") {
|
||||
"-fvisibility-inlines-hidden",
|
||||
]
|
||||
} else {
|
||||
if (is_debug) {
|
||||
if (symbol_level != 0) {
|
||||
cflags += [
|
||||
"/Zi",
|
||||
"/FS",
|
||||
]
|
||||
if (symbol_level == 1 && is_clang) {
|
||||
cflags += [ "-gline-tables-only" ]
|
||||
}
|
||||
ldflags += [ "/DEBUG" ]
|
||||
|
||||
# Speed up links with ghash on windows.
|
||||
|
@ -28,4 +28,11 @@ declare_args() {
|
||||
declare_args() {
|
||||
# Whether to build with optimizations.
|
||||
is_optimized = !is_debug
|
||||
|
||||
# Debug info symbol level.
|
||||
if (is_debug) {
|
||||
symbol_level = 2
|
||||
} else {
|
||||
symbol_level = 0
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user