浏览代码

Merge pull request #96785 from akien-mga/scons-lto-use-thinlto-llvm

SCons: Make `lto=auto` prefer ThinLTO over full LTO for LLVM targets
Rémi Verschelde 8 月之前
父节点
当前提交
fcc9e3a711
共有 3 个文件被更改,包括 6 次插入6 次删除
  1. 2 2
      platform/linuxbsd/detect.py
  2. 2 2
      platform/web/detect.py
  3. 2 2
      platform/windows/detect.py

+ 2 - 2
platform/linuxbsd/detect.py

@@ -184,8 +184,8 @@ def configure(env: "SConsEnvironment"):
 
     # LTO
 
-    if env["lto"] == "auto":  # Full LTO for production.
-        env["lto"] = "full"
+    if env["lto"] == "auto":  # Enable LTO for production.
+        env["lto"] = "thin" if env["use_llvm"] else "full"
 
     if env["lto"] != "none":
         if env["lto"] == "thin":

+ 2 - 2
platform/web/detect.py

@@ -117,8 +117,8 @@ def configure(env: "SConsEnvironment"):
 
     # LTO
 
-    if env["lto"] == "auto":  # Full LTO for production.
-        env["lto"] = "full"
+    if env["lto"] == "auto":  # Enable LTO for production.
+        env["lto"] = "thin"
 
     if env["lto"] != "none":
         if env["lto"] == "thin":

+ 2 - 2
platform/windows/detect.py

@@ -762,8 +762,8 @@ def configure_mingw(env: "SConsEnvironment"):
 
     ## LTO
 
-    if env["lto"] == "auto":  # Full LTO for production with MinGW.
-        env["lto"] = "full"
+    if env["lto"] == "auto":  # Enable LTO for production with MinGW.
+        env["lto"] = "thin" if env["use_llvm"] else "full"
 
     if env["lto"] != "none":
         if env["lto"] == "thin":