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 2
2
import subprocess
3
3
4
4
5
+ def using_emcc (env ):
6
+ return "emcc" in os .path .basename (env ["CC" ])
7
+
8
+
5
9
def using_clang (env ):
6
10
return "clang" in os .path .basename (env ["CC" ])
7
11
@@ -89,7 +93,13 @@ def generate(env):
89
93
# Adding dwarf-4 explicitly makes stacktraces work with clang builds,
90
94
# otherwise addr2line doesn't understand them.
91
95
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 :
93
103
env .Append (CCFLAGS = ["-g3" ])
94
104
else :
95
105
env .Append (CCFLAGS = ["-g2" ])
You can’t perform that action at this time.
0 commit comments