diff --git a/platform/web/detect.py b/platform/web/detect.py index 2a8011ec5b7..27556926ffc 100644 --- a/platform/web/detect.py +++ b/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.