<div dir="ltr">Hi Pierrick,<div><br><div class="gmail_quote">On Mon, Mar 2, 2015 at 1:58 AM Pierrick Bouvier <<a href="mailto:bouvier.pierrick@yahoo.fr">bouvier.pierrick@yahoo.fr</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Clang community,<br>
<br>
I am currently working on a tool able to generate a compilation database<br>
by catching all exec done, something similar to<br>
<a href="https://github.com/rizsotto/Bear" target="_blank">https://github.com/rizsotto/<u></u>Bear</a> but with the end goal of providing more<br>
than just this feature to user (I want to use libclang for providing<br>
autocompletion, refactoring, stats and other stuff related to user's<br>
codebase, independently of any editor or IDE).<br>
<br>
I really like the idea of compilation database, and I have a few<br>
questions that were not answered by the manual page:<br>
<a href="http://clang.llvm.org/docs/JSONCompilationDatabase.html" target="_blank">http://clang.llvm.org/docs/<u></u>JSONCompilationDatabase.html</a><br>
<br>
Those are my questions:<br>
1) Is that possible to provide a cwd relative to compilation database<br>
file itself? What I aim is possibility for user to move his source<br>
folder from place without having to use sed or regenerate the<br>
compilation database. For example, if compilation database is<br>
"/my/project/compilation_<u></u>database.json" and my source is in<br>
"/my/project/src/main.cpp" I want to offer cwd as "src/" and source file<br>
as "main.cpp". Is this correct and more than all, is that supported by<br>
libclang?<br></blockquote><div><br></div><div>I don't think that's currently supported, but patches are welcome :)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2) Is that possible to extend compilation_database without breaking<br>
libclang? I would like to add a list of fields named "dependency" to<br>
precise which files the source depends on. This can be used for creating<br>
statistics or simply to know if file (or any dep) has changed without<br>
having to preprocess, thus enabling speedlight on big projects.<br>
For example:<br>
   - cwd "src/"<br>
   - file "main.cpp"<br>
   - command ...<br>
   - dependency "/usr/include/stdio.h"<br>
   - dependency "/usr/include/stdlib.h"<br>
<br>
If those feature are not possible with current libclang, and if you<br>
agree, I can work on a patch to make this possible.<br></blockquote><div><br></div><div>Two part answer:</div><div>a) regarding local extensions to the command line database: I'd suggest not to do them; the probability we hit incompatibilities seem high enough, and it seems easy to just put another json file next to the compilation database having all your extra data</div><div>b) regrading dependencies: I'm not sure the compilation database is the right venue for that; that's why we have build systems; if you want dependencies, you'll immediately need information on how to build those dependencies, and suddenly you have a new build system</div><div><br></div><div>Cheers,</div><div>/Manuel</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thank you, and thank you again for providing clang/llvm to people.<br>
Pierrick<br>
______________________________<u></u>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">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/<u></u>mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div></div>