summaryrefslogtreecommitdiffstats
path: root/tools/windows.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/windows.py')
-rw-r--r--tools/windows.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/windows.py b/tools/windows.py
index 2e8d609..490b9f7 100644
--- a/tools/windows.py
+++ b/tools/windows.py
@@ -198,4 +198,12 @@ def generate(env):
env.Append(CPPDEFINES=["WINDOWS_ENABLED"])
+ # Refer to https://github.com/godotengine/godot/blob/master/platform/windows/detect.py
+ if env["lto"] == "auto":
+ if env.get("is_msvc", False):
+ # No LTO by default for MSVC, doesn't help.
+ env["lto"] = "none"
+ else: # Release
+ env["lto"] = "full"
+
common_compiler_flags.generate(env)