Merge pull request #91800 from Faless/web/fix_symbols

[Web] Fix debug symbols in web builds
This commit is contained in:
Rémi Verschelde 2024-07-11 00:26:56 +02:00
commit 12a363fcac
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -716,7 +716,13 @@ else:
# Adding dwarf-4 explicitly makes stacktraces work with clang builds, # Adding dwarf-4 explicitly makes stacktraces work with clang builds,
# otherwise addr2line doesn't understand them # otherwise addr2line doesn't understand them
env.Append(CCFLAGS=["-gdwarf-4"]) 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"]) env.Append(CCFLAGS=["-g3"])
else: else:
env.Append(CCFLAGS=["-g2"]) env.Append(CCFLAGS=["-g2"])