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

Manuel Klimek klimek at google.com
Tue Aug 13 23:44:04 PDT 2013


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.

The next thing we'll need is to be able to translate cl.exe command line
options to clang's. One way to do this is to use the ArgumentAdjuster to
replace the cl.exe flags with the corresponding clang flags - again,
somebody would need to implement this.

If nobody beats us to it, at some point we'll most certainly get there, but
currently, it's not too high on our priority list. Thus, patches welcome :)

Cheers,
/Manuel



On Tue, Aug 13, 2013 at 11:02 AM, Richard <legalize at xmission.com> wrote:

>
> In article <CACs=ty+Bzw=
> 1ZdNYhBRmSBDqt_y_O19dFd1Rb+hKj8EohZBykQ at mail.gmail.com>,
>     Reid Kleckner <rnk at google.com> writes:
>
> > On Tue, Aug 13, 2013 at 12:08 AM, Richard <legalize at xmission.com> wrote:
> >
> > > > What generator (-G) are you using?
> > >
> > > When I originally created the build structure, I generated VS 2012
> > > project files.
> >
> >
> > Searching the CMake source, I only see mentions of
> > CMAKE_EXPORT_COMPILE_COMMANDS in the make and ninja generators.  The
> > feature is probably unimplemented for Visual Studio project files.
>
> OK, I'm a little confused.  The page that explains how to generate
> this json file doesn't mention anything about generators or -G.
>
> Are the directions on the page simply assuming somethign that isn't true
> in this case?
>
> > ninja works fairly well with the MSVC toolchain so you could try that.
>
> I don't need to actually change the way I'm building the code -- I
> still want VS projects for building the code.  I just need to create
> this JSON file.
>
> As I understand it, this JSON file feeds clang all the necessary
> include search paths and relevant preprocessor symbol definitions in
> order to properly interpret the source code in a particular
> compilation context.
> --
> "The Direct3D Graphics Pipeline" free book <
> http://tinyurl.com/d3d-pipeline>
>      The Computer Graphics Museum <http://computergraphicsmuseum.org>
>          The Terminals Wiki <http://terminals.classiccmp.org>
>   Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130813/4643788b/attachment.html>


More information about the cfe-dev mailing list