Skip to content

Commit 39433a3

Browse files
aykevldeadprogram
authored andcommitted
compileopts: automatically add -g flag when including debug symbols
Debug information is often useful and there is no reason to include it for Go code but not for C code. Also, disabling debug information should disable it entirely, not just for Go code.
1 parent 04d097f commit 39433a3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

compileopts/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ func (c *Config) CFlags() []string {
176176
cflags = append(cflags, "-nostdlibinc", "-Xclang", "-internal-isystem", "-Xclang", filepath.Join(root, "lib", "picolibc", "newlib", "libc", "include"))
177177
cflags = append(cflags, "-I"+filepath.Join(root, "lib/picolibc-include"))
178178
}
179+
if c.Debug() {
180+
cflags = append(cflags, "-g")
181+
}
179182
return cflags
180183
}
181184

targets/gameboy-advance.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"rtlib": "compiler-rt",
1010
"libc": "picolibc",
1111
"cflags": [
12-
"-g",
1312
"--target=arm4-none-eabi",
1413
"-mcpu=arm7tdmi",
1514
"-Oz",

0 commit comments

Comments
 (0)