From ce4f64583a14a884aa5d0283d3d759bc4c4073f1 Mon Sep 17 00:00:00 2001 From: Adam Scott Date: Thu, 10 Apr 2025 10:27:19 -0400 Subject: [PATCH] Add the equivalent of `-Werror` for `wasm-ld` --- platform/web/detect.py | 4 ++++ 1 file changed, 4 insertions(+) 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.