瀏覽代碼

Add the equivalent of `-Werror` for `wasm-ld`

Adam Scott 5 月之前
父節點
當前提交
ce4f64583a
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      platform/web/detect.py

+ 4 - 0
platform/web/detect.py

@@ -130,6 +130,10 @@ def configure(env: "SConsEnvironment"):
     ## Copy env variables.
     env["ENV"] = os.environ
 
+    # This makes `wasm-ld` treat all warnings as errors.
+    if env["werror"]:
+        env.Append(LINKFLAGS=["-Wl,--fatal-warnings"])
+
     # LTO
 
     if env["lto"] == "auto":  # Enable LTO for production.