<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Apr 28, 2014 at 6:55 PM, Manuel Klimek <span dir="ltr"><<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="">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><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><div>Btw, this is how we do it when we have tools that must run without a file system.</div>
</div></div></div></blockquote><div><br></div><div>For reference, I tried to replicate Olivier's setup a while back and failed miserably with MSVC.</div><div><br></div><div>The builtin string literals get too large -- MSVC appears to have a limit of 64K -- so the generated header becomes invalid. :-/</div>
<div><br></div><div>For MSVC, I'd probably have to consider generating resource files, but then the wiring becomes entirely different and much more convoluted. I'll save it for a rainy day.</div><div><br></div><div>
- Kim</div></div></div></div>