Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

SCons: Enable werror for non-MSVC linkers

Thaddeus Crews133ee0f1a6f8
diff --git a/SConstruct b/SConstruct
index d8d930106ba..b44cd914daf 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1030,6 +1030,7 @@ else: # GCC, Clang
if env["werror"]:
env.AppendUnique(CCFLAGS=["-Werror"])
+ env.AppendUnique(LINKFLAGS=["-Wl,--fatal-warnings" if env["platform"] != "macos" else "-Wl,-fatal_warnings"])
if hasattr(detect, "get_program_suffix"):
suffix = "." + detect.get_program_suffix()
diff --git a/platform/web/detect.py b/platform/web/detect.py
index 57b79b2c3e6..fb7c20f4c74 100644
--- a/platform/web/detect.py
+++ b/platform/web/detect.py
@@ -164,10 +164,6 @@ 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.
env["lto"] = "thin"