Specifying compile_commands.json file in a .clang-tidy configuration file

Viewed 772

I am trying to use clang-tidy for my project, using a .clang-tidy config file. IDE integration tool I used for clang-tidy is telling me that it can't find compile_commands.json file. I figured this is because I use out-of-source builds and I need to somehow encode this information on my .clang-tidy configuration. I was not able to find any pointers on documentation or online examples.

How do we specify the path to compile_commands.json file using the .clang-tidy configuration file?

1 Answers

There is no difference whether you use .clang-tidy configuration file or not. When you invoke clang-tidy, the -p <build-path> option can be used to specify the directory that contains the compile_commands.json.

Related