diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-09-08 11:24:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-08 11:24:43 +0200 |
commit | 8b79a19426c7f5eab04caa573866276c76c70871 (patch) | |
tree | 3c93bbc143612aa2d5487b9c0918b74629bdd714 /platform/linuxbsd/detect.py | |
parent | 69233093d7e6479b5130bf2c39cbf464a6809c1b (diff) | |
parent | c2c659db326591519d451d368c4e33c78bb9c1fa (diff) |
Merge pull request #63288 from akien-mga/scons-refactor-lto
Diffstat (limited to 'platform/linuxbsd/detect.py')
-rw-r--r-- | platform/linuxbsd/detect.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/platform/linuxbsd/detect.py b/platform/linuxbsd/detect.py index f5f7e65417..36644d5f29 100644 --- a/platform/linuxbsd/detect.py +++ b/platform/linuxbsd/detect.py @@ -31,7 +31,6 @@ def get_opts(): return [ EnumVariable("linker", "Linker program", "default", ("default", "bfd", "gold", "lld", "mold")), BoolVariable("use_llvm", "Use the LLVM compiler", False), - BoolVariable("use_thinlto", "Use ThinLTO (LLVM only, requires linker=lld, implies use_lto=yes)", False), BoolVariable("use_static_cpp", "Link libgcc and libstdc++ statically for better portability", True), BoolVariable("use_coverage", "Test Godot coverage", False), BoolVariable("use_ubsan", "Use LLVM/GCC compiler undefined behavior sanitizer (UBSAN)", False), @@ -129,13 +128,6 @@ def configure(env): else: env.Append(LINKFLAGS=["-fuse-ld=%s" % env["linker"]]) - if env["use_thinlto"]: - if not env["use_llvm"] or env["linker"] != "lld": - print("ThinLTO is only compatible with LLVM and the LLD linker, use `use_llvm=yes linker=lld`.") - sys.exit(255) - else: - env["use_lto"] = True # ThinLTO implies LTO - if env["use_coverage"]: env.Append(CCFLAGS=["-ftest-coverage", "-fprofile-arcs"]) env.Append(LINKFLAGS=["-ftest-coverage", "-fprofile-arcs"]) @@ -178,8 +170,12 @@ def configure(env): env.Append(CCFLAGS=["-fsanitize-recover=memory"]) env.Append(LINKFLAGS=["-fsanitize=memory"]) - if env["use_lto"]: - if env["use_thinlto"]: + # LTO + if env["lto"] != "none": + if env["lto"] == "thin": + if not env["use_llvm"]: + print("ThinLTO is only compatible with LLVM, use `use_llvm=yes` or `lto=full`.") + sys.exit(255) env.Append(CCFLAGS=["-flto=thin"]) env.Append(LINKFLAGS=["-flto=thin"]) elif not env["use_llvm"] and env.GetOption("num_jobs") > 1: |