From 35a15e619161798820b2bd6ff46178c5b7ccebcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 13 Sep 2022 17:01:47 +0200 Subject: SCons: Refactor handling of `production` flag and per-platform LTO defaults Fixup to #63288. See #65583 for the bug report. Co-authored-by: Cyberrebell --- platform/windows/detect.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'platform/windows') diff --git a/platform/windows/detect.py b/platform/windows/detect.py index e6e1874fc0..52a959b34a 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -448,6 +448,9 @@ def configure_msvc(env, vcvars_msvc_config): ## LTO + if env["lto"] == "auto": # No LTO by default for MSVC, doesn't help. + env["lto"] = "none" + if env["lto"] != "none": if env["lto"] == "thin": print("ThinLTO is only compatible with LLVM, use `use_llvm=yes` or `lto=full`.") @@ -564,6 +567,11 @@ def configure_mingw(env): if try_cmd("gcc-ranlib --version", env["mingw_prefix"], env["arch"]): env["RANLIB"] = mingw_bin_prefix + "gcc-ranlib" + ## LTO + + if env["lto"] == "auto": # Full LTO for production with MinGW. + env["lto"] = "full" + if env["lto"] != "none": if env["lto"] == "thin": if not env["use_llvm"]: -- cgit v1.2.3