<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Apr 28, 2014 at 9:51 AM, Olivier Goffart <span dir="ltr"><<a href="mailto:ogoffart@kde.org" target="_blank">ogoffart@kde.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Sunday 27 April 2014 15:31:53 Dmitri Gribenko wrote:<br>
> On Sun, Apr 27, 2014 at 3:09 PM, Jacob Carlborg <<a href="mailto:doob@me.com">doob@me.com</a>> wrote:<br>
> > It would be nice if the header files could be embedded in the tool (the<br>
> > executable).<br>
><br>
> Now that Clang has a VFS, this should not be hard to implement.<br>
<br>
</div>I have been doing that even before clang had a VFS.<br>
<br>
The idea is using cmake to put the content of the file in the binary<br>
<br>
Using this cmake script<br>
<a href="https://github.com/woboq/moc-ng/blob/master/src/CMakeLists.txt#L57" target="_blank">https://github.com/woboq/moc-ng/blob/master/src/CMakeLists.txt#L57</a><br>
and<br>
<a href="https://github.com/woboq/moc-ng/blob/master/src/embedded_includes.h.in" target="_blank">https://github.com/woboq/moc-ng/blob/master/src/embedded_includes.h.in</a><br>
This puts the file contents into the binary<br>
<br>
Then I added a "-I/builtins" to the command line, and used<br>
ToolInvocation::mapVirtualFile to expose the files:<br>
<a href="http://code.woboq.org/mocng/src/main.cpp.html#354" target="_blank">http://code.woboq.org/mocng/src/main.cpp.html#354</a></blockquote><div><br></div><div>Btw, this is how we do it when we have tools that must run without a file system.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Olivier<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div></div>