<div dir="ltr">Hi Jacob, <div><br></div><div>I couldn't get it working that way.</div><div><br></div><div>Thank you,</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-02-02 21:50 GMT+00:00 Jacob Carlborg via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 2016-02-02 16:57, Mikhail Ramalho via cfe-dev wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello all,<br>
<br>
I'm using clang as a frontend to parse C and C++ code, which I convert<br>
to an internal format that my tool understand.<br>
<br>
Since the beginning of the development, there was the problem including<br>
the builtin headers to the compilation which I kinda fix with a code to<br>
search for headers on the system.<br>
<br>
The problem is that we ship the binary, including static and dynamic<br>
versions, which requires that the users to have clang installed on their<br>
machines. It's OK for the dynamic version but for the static one it's a<br>
bad solution.<br>
<br>
So, right now I only found this two solutions:<br>
<br>
1. Either the user must have clang installed in their machines (which I<br>
can't tell if there will be a problem about using headers from different<br>
versions of clang).<br>
<br>
2. Ship all the builtin headers, even for the static version, and hard<br>
code a path for them from the binary (like clang does).<br>
<br>
Is it possible to implement a third solution: circumvent the requirement<br>
for all the builtin headers? I even tried to copy the builitin headers<br>
as virtualFiles, but it doesn't work.<br>
</blockquote>
<br></span>
In my tool, DStep [1], I've embedded the headers in the executable itself. The tool is built using libclang. I'm using an array of "CXUnsavedFile" [2] for the internal headers which is passed when parsing the translation unit [3][4].<br>
<br>
Not sure if that helps since you're using the C++ API.<br>
<br>
[1] <a href="https://github.com/jacob-carlborg/dstep" rel="noreferrer" target="_blank">https://github.com/jacob-carlborg/dstep</a><br>
<br>
[2] <a href="https://github.com/jacob-carlborg/dstep/blob/master/clang/Compiler.d#L48" rel="noreferrer" target="_blank">https://github.com/jacob-carlborg/dstep/blob/master/clang/Compiler.d#L48</a><br>
<br>
[3] <a href="https://github.com/jacob-carlborg/dstep/blob/master/dstep/driver/Application.d#L96" rel="noreferrer" target="_blank">https://github.com/jacob-carlborg/dstep/blob/master/dstep/driver/Application.d#L96</a><br>
<br>
[4] <a href="https://github.com/jacob-carlborg/dstep/blob/master/clang/TranslationUnit.d#L35-L36" rel="noreferrer" target="_blank">https://github.com/jacob-carlborg/dstep/blob/master/clang/TranslationUnit.d#L35-L36</a><span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
/Jacob Carlborg</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><br></div><div>Mikhail Ramalho.</div></div></div>
</div>