Skip to content

Commit

Permalink
[Web] Fix debug symbols in web builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Faless committed Jul 10, 2024
1 parent 26d1577 commit 3d553ec
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,13 @@ else:
# Adding dwarf-4 explicitly makes stacktraces work with clang builds,
# otherwise addr2line doesn't understand them
env.Append(CCFLAGS=["-gdwarf-4"])
if env.dev_build:
if methods.using_emcc(env):
# Emscripten only produces dwarf symbols when using "-g3".
env.Append(CCFLAGS=["-g3"])
# Emscripten linker needs debug symbols options too.
env.Append(LINKFLAGS=["-gdwarf-4"])
env.Append(LINKFLAGS=["-g3"])
elif env.dev_build:
env.Append(CCFLAGS=["-g3"])
else:
env.Append(CCFLAGS=["-g2"])
Expand Down

0 comments on commit 3d553ec

Please sign in to comment.