Visual Studio was added a lot of support for Clang.
I want to use clang-tidy.exe for a Visual-Studio project. In order to do that I need the JSON "compilation database".
Is there some way to export this database from a visual studio (2015) project?
A compilation database is a JSON file, which consist of an array of “command objects”, where each command object specifies one way a translation unit is compiled in the project. Each command object contains the translation unit's main file, the working directory of the compile run and the actual compile command.
A compilation database is a JSON-formatted file named compile_commands. json that contains structured data about every compilation unit in your project.
To export the JSON compilation Database you can use the Clang Power Tools VS extension.
All you need to do is to select your VS project from Solution Explorer, open the context menu by pressing right-click on it, and then search for Clang Power Tools. In the submenu search for the Export Compilation Database option. The JSON compilation database will be automatically generated for you.
More details about this feature can be found in this article.
The extension is compatible with Visual Studio 2015, 2017 and 2019.
I've bumped into your question whilst searching for an answer to this very problem. This is what I have found so far:
HTH.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With