File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 22import subprocess
33
44
5+ def using_emcc (env ):
6+ return "emcc" in os .path .basename (env ["CC" ])
7+
8+
59def using_clang (env ):
610 return "clang" in os .path .basename (env ["CC" ])
711
@@ -89,7 +93,13 @@ def generate(env):
8993 # Adding dwarf-4 explicitly makes stacktraces work with clang builds,
9094 # otherwise addr2line doesn't understand them.
9195 env .Append (CCFLAGS = ["-gdwarf-4" ])
92- if env .dev_build :
96+ if using_emcc (env ):
97+ # Emscripten only produces dwarf symbols when using "-g3".
98+ env .AppendUnique (CCFLAGS = ["-g3" ])
99+ # Emscripten linker needs debug symbols options too.
100+ env .AppendUnique (LINKFLAGS = ["-gdwarf-4" ])
101+ env .AppendUnique (LINKFLAGS = ["-g3" ])
102+ elif env .dev_build :
93103 env .Append (CCFLAGS = ["-g3" ])
94104 else :
95105 env .Append (CCFLAGS = ["-g2" ])
You can’t perform that action at this time.
0 commit comments