rnk added a comment.

So, I actually went ahead and generated some MSYS makefiles and made a 
compile_commands.json, and it doesn't work with clang-tidy. You get this kind 
of output:

  [
  {
    "directory": "C:/src/test_proj",
    "command": "\"/C/Program 
Files/mingw-w64/x86_64-6.1.0-win32-seh-rt_v5-rev0/mingw64/bin/g++.exe\"    
-Dsomething\\evil -o CMakeFiles/foo.dir/foo.obj -c /C/src/test_proj/foo.cpp",
    "file": "C:/src/test_proj/foo.cpp"
  }
  ]
  ...
  $ clang-tidy foo.cpp
  1 error generated.
  Error while processing C:\src\test_proj\foo.cpp.
  error: error reading '/C/src/test_proj/foo.cpp' [clang-diagnostic-error]

Hypothetically we could make this work, but there are bigger problems here. In 
that light, I think we should go with this patch. Long term, we should solve 
this problem by emitting "arguments" or "command_shell" in cmake.


https://reviews.llvm.org/D23455



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to