Merge pull request #96813 from Repiteo/scons/fix-clang-cl-flags

SCons: Fix `clang-cl` link/ar flags
This commit is contained in:
Rémi Verschelde 2024-09-23 12:27:59 +02:00
commit 648b21b9ba
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 7 additions and 9 deletions

View File

@ -620,18 +620,16 @@ def configure_msvc(env: "SConsEnvironment", vcvars_msvc_config):
print("ThinLTO is only compatible with LLVM, use `use_llvm=yes` or `lto=full`.") print("ThinLTO is only compatible with LLVM, use `use_llvm=yes` or `lto=full`.")
sys.exit(255) sys.exit(255)
env.Append(CCFLAGS=["-flto=thin"]) env.AppendUnique(CCFLAGS=["-flto=thin"])
env.Append(LINKFLAGS=["-flto=thin"])
elif env["use_llvm"]: elif env["use_llvm"]:
env.Append(CCFLAGS=["-flto"]) env.AppendUnique(CCFLAGS=["-flto"])
env.Append(LINKFLAGS=["-flto"])
else: else:
env.AppendUnique(CCFLAGS=["/GL"]) env.AppendUnique(CCFLAGS=["/GL"])
env.AppendUnique(ARFLAGS=["/LTCG"])
if env["progress"]: if env["progress"]:
env.AppendUnique(LINKFLAGS=["/LTCG:STATUS"]) env.AppendUnique(LINKFLAGS=["/LTCG:STATUS"])
else: else:
env.AppendUnique(LINKFLAGS=["/LTCG"]) env.AppendUnique(LINKFLAGS=["/LTCG"])
env.AppendUnique(ARFLAGS=["/LTCG"])
if vcvars_msvc_config: if vcvars_msvc_config:
env.Prepend(CPPPATH=[p for p in str(os.getenv("INCLUDE")).split(";")]) env.Prepend(CPPPATH=[p for p in str(os.getenv("INCLUDE")).split(";")])