We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1421ba2 + 9ea9b47 commit 3830fe4Copy full SHA for 3830fe4
1 file changed
tools/common_compiler_flags.py
@@ -2,6 +2,10 @@
2
import subprocess
3
4
5
+def using_emcc(env):
6
+ return "emcc" in os.path.basename(env["CC"])
7
+
8
9
def using_clang(env):
10
return "clang" in os.path.basename(env["CC"])
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:
103
env.Append(CCFLAGS=["-g3"])
104
else:
105
env.Append(CCFLAGS=["-g2"])
0 commit comments