瀏覽代碼

[Web] Fix debug symbols in web builds

Fabio Alessandrelli 1 年之前
父節點
當前提交
3d553eccdf
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      SConstruct

+ 7 - 1
SConstruct

@@ -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"])