[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-dev
Subject:    Re: [cfe-dev] Standalone tools
From:       Kim Gräsman <kim.grasman () gmail ! com>
Date:       2014-08-01 7:36:56
Message-ID: CANt7B+dNzPL_LavT8f9eFqeyrrQvZxQ0xnn=oYFvWAp8oqGB2g () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Mon, Apr 28, 2014 at 6:55 PM, Manuel Klimek <klimek@google.com> wrote:

> On Mon, Apr 28, 2014 at 9:51 AM, Olivier Goffart <ogoffart@kde.org> wrote:
>
>>
>> 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.
>

For reference, I tried to replicate Olivier's setup a while back and failed
miserably with MSVC.

The builtin string literals get too large -- MSVC appears to have a limit
of 64K -- so the generated header becomes invalid. :-/

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.

- Kim

[Attachment #5 (text/html)]

<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">&lt;<a href="mailto:klimek@google.com" \
target="_blank">klimek@google.com</a>&gt;</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">&lt;<a href="mailto:ogoffart@kde.org" \
target="_blank">ogoffart@kde.org</a>&gt;</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 &quot;-I/builtins&quot; 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&#39;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&#39;d probably have to consider generating resource \
files, but then the wiring becomes entirely different and much more convoluted. \
                I&#39;ll save it for a rainy day.</div><div><br></div><div>
- Kim</div></div></div></div>



_______________________________________________
cfe-dev mailing list
cfe-dev@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic