[cfe-dev] compile_commands.json for Windows/MSVC

Kim Gräsman kim.grasman at gmail.com
Wed Aug 14 01:57:07 PDT 2013


On Wed, Aug 14, 2013 at 9:23 AM, Chandler Carruth <chandlerc at google.com> wrote:
> On Tue, Aug 13, 2013 at 11:44 PM, Manuel Klimek <klimek at google.com> wrote:
>>
>> AFAIK nobody implemented json compile command output for Windows yet (back
>> in the days when I implemented it, clang was so unusable on windows that
>> nobody cared). So, currently, your approach with scrapping the compile
>> commands from the visual studio make files seems a way to go.
>
> As an alternative, you could add direct support to the tooling library for
> querying Visual Studio for the commandline if there is a reasonable IPC
> mechanism for doing that.
>
> As another alternative, you could add a plugin to Visual Studio that caused
> it to write out the json database whenever the project settings changed...
> If there is a reasonable plugin layer to do that.

I'd prefer to parse the VS project files and spit out a compilation
database. They are plain XML and as of VS2010 (I think) supposed to be
backward compatible, so it's a stable format.

I could probably help with VS IPC if that's something you want to
pursue, but it's usually pretty painful and less stable than just
interpreting the project file format.

I agree that CMake should be kept out of this loop; there are LOTS of
Windows-only projects maintaining their build systems as Visual Studio
solutions.

- Kim



More information about the cfe-dev mailing list