[cfe-dev] Standalone tools

Manuel Klimek klimek at google.com
Mon Apr 28 09:55:03 PDT 2014


On Mon, Apr 28, 2014 at 9:51 AM, Olivier Goffart <ogoffart at kde.org> wrote:

> On Sunday 27 April 2014 15:31:53 Dmitri Gribenko wrote:
> > On Sun, Apr 27, 2014 at 3:09 PM, Jacob Carlborg <doob at me.com> wrote:
> > > It would be nice if the header files could be embedded in the tool (the
> > > executable).
> >
> > Now that Clang has a VFS, this should not be hard to implement.
>
> I have been doing that even before clang had a VFS.
>
> The idea is using cmake to put the content of the file in the binary
>
> Using this cmake script
> https://github.com/woboq/moc-ng/blob/master/src/CMakeLists.txt#L57
> and
> https://github.com/woboq/moc-ng/blob/master/src/embedded_includes.h.in
> This puts the file contents into the binary
>
> Then I added a "-I/builtins" to the command line, and used
> ToolInvocation::mapVirtualFile to expose the files:
> http://code.woboq.org/mocng/src/main.cpp.html#354


Btw, this is how we do it when we have tools that must run without a file
system.


>
>
> --
> Olivier
> _______________________________________________
> 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/20140428/7168f105/attachment.html>


More information about the cfe-dev mailing list