[cfe-dev] clang-tidy and response file in the compile_commands

Владимир Пляшкун via cfe-dev cfe-dev at lists.llvm.org
Fri Jan 13 05:55:03 PST 2017


Hi, i have a problem with clang-tidy and compile_commands.json. 
On my Windows machine, CMake generates compile_commands.json in the following way: 
[ 
{ 
  "directory": "...", 
  "command": "C:/mingw64/bin/g++.exe  @CMakeFiles/project.dir/includes_CXX.rsp  -std=c++11 ...", 
  "file": "..." 
} 
] 
The main problem, is that due to command-line-length restriction, CMake uses response file (see "@CMakeFiles/project.dir/includes_CXX.rsp" argument) for additional includes.  When i'm calling clang-tidy to analyze my project: 
"clang-tidy -checks=* -p="<path-to-compile_commands_directory>" "file.cpp"" i'm getting 
"@CMakeFiles/project.dir/includes_CXX.rsp: 'linker' input unused [clang-diagnostic-unused-command-line-argument]" and dozens of messages (header not found) because of that. 
Does clang-tidy support response-files in the compile_commands.json? It seems that it has some problems with it at the moment.



More information about the cfe-dev mailing list