Skip to content

Commit f6f2db5

Browse files
committed
Force LTO on windows MSVC
This silences the linker complaining that libgit uses LTO but we are not linking with it.
1 parent 392b3d6 commit f6f2db5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

SConstruct

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ ARGUMENTS["target"] = "editor"
2525
env = SConscript("godot-cpp/SConstruct").Clone()
2626
env.PrependENVPath("PATH", os.getenv("PATH")) # Prepend PATH, done upstream in recent godot-cpp verions.
2727

28+
# Force linking with LTO on windows MSVC, silence the linker complaining that libgit uses LTO but we are not linking with it.
29+
if env["platform"] == "windows" and env.get("is_msvc", False):
30+
env.AppendUnique(LINKFLAGS=["/LTCG"])
31+
2832
# OpenSSL Builder
2933
env.Tool("openssl", toolpath=["tools"])
3034

0 commit comments

Comments
 (0)