clazy analysis of non-cmake projects (tip; generating compile_commands.json from Makefile)

René J.V. Bertin rjvbertin at
Fri Oct 19 08:37:11 BST 2018


Quick share hoping this was not an open door for everyone but me.

The clazy analysis plugin needs a compile_commands.json file which is usually present the build directory of projects that use cmake (*). Not so with other project types, including those using qmake.

I found a make-to-compile_commands.json utility that seems to work well and doesn't require building the entire project:

Generating the compile_commands.json file without building the entire project is done with
%> (cd $build.dir ; compiledb make -n)

and to keep the file up-to-date the command can be configured in the project's make config settings (`compiledb make` instead of make).


*) not after the initial import with the cmake server project manager?

More information about the KDevelop mailing list