From f6f2db53a9115d9fbfeb5c20b595e4425560c80a Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Tue, 27 May 2025 12:08:18 +0200 Subject: [PATCH] Force LTO on windows MSVC This silences the linker complaining that libgit uses LTO but we are not linking with it. --- SConstruct | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SConstruct b/SConstruct index d5c5f0e..1f2c62b 100644 --- a/SConstruct +++ b/SConstruct @@ -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"])