Make clang debug level configurable
The -g flag is controllable with CLANG_DEFAULT_DEBUG_LEVEL from -g0 to -g3. The default remains -g Test: Build with CLANG_DEFAULT_DEBUG_LEVEL=debug_level_1 Change-Id: I913d3a0cb028484f9496a7e0a2298852f9b699cd
This commit is contained in:
@@ -48,7 +48,6 @@ var (
|
|||||||
"-Wno-multichar",
|
"-Wno-multichar",
|
||||||
|
|
||||||
"-O2",
|
"-O2",
|
||||||
"-g",
|
|
||||||
"-fdebug-default-version=5",
|
"-fdebug-default-version=5",
|
||||||
|
|
||||||
"-fno-strict-aliasing",
|
"-fno-strict-aliasing",
|
||||||
@@ -374,6 +373,21 @@ func init() {
|
|||||||
flags = append(flags, "-Wno-error=unknown-warning-option")
|
flags = append(flags, "-Wno-error=unknown-warning-option")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch ctx.Config().Getenv("CLANG_DEFAULT_DEBUG_LEVEL") {
|
||||||
|
case "debug_level_0":
|
||||||
|
flags = append(flags, "-g0")
|
||||||
|
case "debug_level_1":
|
||||||
|
flags = append(flags, "-g1")
|
||||||
|
case "debug_level_2":
|
||||||
|
flags = append(flags, "-g2")
|
||||||
|
case "debug_level_3":
|
||||||
|
flags = append(flags, "-g3")
|
||||||
|
case "debug_level_g":
|
||||||
|
flags = append(flags, "-g")
|
||||||
|
default:
|
||||||
|
flags = append(flags, "-g")
|
||||||
|
}
|
||||||
|
|
||||||
return strings.Join(flags, " ")
|
return strings.Join(flags, " ")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user