Force LTO on windows MSVC

This silences the linker complaining that libgit uses LTO but we are not
linking with it.
This commit is contained in:
Fabio Alessandrelli
2025-05-27 12:08:18 +02:00
parent 392b3d6697
commit f6f2db53a9

View File

@@ -25,6 +25,10 @@ ARGUMENTS["target"] = "editor"
env = SConscript("godot-cpp/SConstruct").Clone()
env.PrependENVPath("PATH", os.getenv("PATH")) # Prepend PATH, done upstream in recent godot-cpp verions.
# Force linking with LTO on windows MSVC, silence the linker complaining that libgit uses LTO but we are not linking with it.
if env["platform"] == "windows" and env.get("is_msvc", False):
env.AppendUnique(LINKFLAGS=["/LTCG"])
# OpenSSL Builder
env.Tool("openssl", toolpath=["tools"])