[llvm] [bazel] Disable `-Wmicrosoft-include` for RISCVCodeGen under clang-cl (PR #227867)

via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 17:01:21 PDT 2026


================
@@ -3251,6 +3251,16 @@ llvm_target_lib_list = [lib for lib in [
     {
         "name": "RISCV",
         "short_name": "RISCV",
+        # MCTargetDesc/RISCVTargetStreamer.h does `#include "RISCV.h"` from
+        # the parent directory. From RISCVAsmPrinter.cpp, MSVC's include-stack
+        # rule finds the real file while the normal search hits a
+        # `_virtual_includes` copy first (copied, not symlinked, on Windows).
+        # clang-cl reports the mismatch under -Wmicrosoft-include, fatal with
+        # -Werror. Same header either way; CMake avoids it via -I<target dir>.
+        "codegen_copts": select({
----------------
UebelAndre wrote:

I somehow forgot to add that to this commit. I've added it but after discussion with `@keith` I ended up authoring https://github.com/llvm/llvm-project/pull/228282 which I think is a better fix.

https://github.com/llvm/llvm-project/pull/227867


More information about the llvm-commits mailing list