7

I have a few Windows projects based on qmake, and these are built daily on Jenkins. Jenkins is running on a Windows machine, and my projects build fine using a "Windows batch Command", which is pretty much the same as running a good old batch (.bat) file.

Qt creator nowadays has clang-tidy and clazy integrated, and these can be run on projects using Qt creator's GUI.

I now would like to have these clang-tidy and clazy checks running on my Jenkins instance on a daily basis.

Is there a way to run these tools from a non-GUI environment for qmake projects?

Edit: I believe I need to add some information on what I have already tried and where I had problems to get something running in a satisfying way.

For clang-tidy, I find it problematic to feed all the project settings like include paths, environment variables and similar into the tool. Qt Creator can do that from its plugin, since it has all the info available there. I see that there is e.g. the possibility to run clang-tidy with a compile_commands.json file to solve this issue. However, I could not find a way to "convert" a qmake .pro file to a compile_commands.json file on Windows. On Linux this would be possible with bear according to this blog post, but there doesn't seem to be an alternative for Windows ...

For clazy, there is the possibility to run it during a normal build as mentioned in their documentation. However, such a build takes too much time to run, and it uses most of the time for unneeded build output which is also undesirable. The reason it takes so long is that I had to switch the build to a singlecore build, because otherwise I got unsynced, scrambled text output which I then cannot parse properly.

I am also aware that Qt creator can generate a compile_commands.json file in its build menu for a project that is currently open. This however seems to be buried in the IDE code and not usable without the GUI ...

Or maybe it is possible to get the tools running based on the generated makefiles or a generated visual studio project file? All these things seem pretty complicated and error-prone for me, and I really hope that there is an easy way to get something running here.

FourtyTwo
  • 1,616
  • 2
  • 15
  • 43

0 Answers0