Quellcode durchsuchen

SCons: Set appropriate prefix when using clang-cl

Thaddeus Crews vor 11 Monaten
Ursprung
Commit
9968828913
1 geänderte Dateien mit 5 neuen und 0 gelöschten Zeilen
  1. 5 0
      platform/windows/detect.py

+ 5 - 0
platform/windows/detect.py

@@ -390,6 +390,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