linter-clang
linter-clang copied to clipboard
Point linter-clang to `compile_commands.json`
AFAICT, there's no way to point linter-clang to a compile_commands.json
file. How exactly is this supposed to work?
https://github.com/Kev/clang-flags/blob/master/lib/clang-flags.coffee#L33
So, the README and the Changelog talk about compile_commands.json
support. Is it true or is it missing ?
I don't know why, but linter-clang seems to ignore my compile_commands.json
. It reports missing header errors but when I test my file with clang-check -analyze <file>
it reports no error.
It was a problem on my side. I use a symlink from my sources to my build workspace, so the sources seen by CMake were on a different location than the ones seen by linter-clang.
The compile_commands.json works fine. Mybe this issue should be closed ?
If I understand @samuela right, a config option is requested to set a path, where to search for compile_commands.json
.
For myself I use a subdirectory for CMake build files and the compile_commands.json
is also written into this directory. However, telling the linter to search in $PROJECT_ROOT/build/
for this file would make a symlink for this file in each project's root superfluous.