linter-clang icon indicating copy to clipboard operation
linter-clang copied to clipboard

Point linter-clang to `compile_commands.json`

Open samuela opened this issue 7 years ago • 4 comments

AFAICT, there's no way to point linter-clang to a compile_commands.json file. How exactly is this supposed to work?

samuela avatar May 23 '17 22:05 samuela

https://github.com/Kev/clang-flags/blob/master/lib/clang-flags.coffee#L33

keplersj avatar Aug 23 '17 00:08 keplersj

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.

ValentinVERGEZ avatar May 26 '18 15:05 ValentinVERGEZ

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 ?

ValentinVERGEZ avatar May 26 '18 16:05 ValentinVERGEZ

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.

alehaa avatar Nov 21 '18 16:11 alehaa