Merge pull request #96447 from Repiteo/scons/clang-cl-compile_commands

SCons: Set appropriate prefix when using clang-cl
This commit is contained in:
Thaddeus Crews 2024-12-19 19:59:45 -06:00
commit 95b00295fb
No known key found for this signature in database
GPG Key ID: 62181B86FE9E5D84

View File

@ -359,6 +359,11 @@ def configure_msvc(env: "SConsEnvironment", vcvars_msvc_config):
env.AppendUnique(CPPDEFINES=["R128_STDC_ONLY"])
env.extra_suffix = ".llvm" + env.extra_suffix
# Ensure intellisense tools like `compile_commands.json` play nice with MSVC syntax.
env["CPPDEFPREFIX"] = "-D"
env["INCPREFIX"] = "-I"
env.AppendUnique(CPPDEFINES=[("alloca", "_alloca")])
if env["silence_msvc"] and not env.GetOption("clean"):
from tempfile import mkstemp