To get a compilation database from a project:<br><a href="https://github.com/rizsotto/Bear">https://github.com/rizsotto/Bear</a><div>might help.</div><div><br></div><div>Cheers,</div><div>/Manuel<br><div><br></div></div><br><div class="gmail_quote">On Fri Oct 24 2014 at 9:11:54 AM Reid Kleckner <<a href="mailto:rnk@google.com">rnk@google.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Clang has basically three command line flag parsing modes:<br>
- the gcc-compatible clang driver, which is the standard command line interface<br>
- the -cc1 command line interface, which is accessible via "clang -cc1<br>
..." and is printed by -###<br>
- the clang-cl command line interface, which is not relevant here<br>
<br>
The tooling infrastructure expects your compilation database to<br>
contain flags for the main gcc-style frontend, not the -cc1 subprocess<br>
invocation. So -### won't help you here.<br>
<br>
I believe we have some flag that prints the full clang command line<br>
during the compile, but I've forgotten what it is.<br>
<br>
On Fri, Oct 24, 2014 at 4:06 AM, Péter Ésik <<a href="mailto:peter.esik@gmail.com" target="_blank">peter.esik@gmail.com</a>> wrote:<br>
> Hello<br>
><br>
> I would like to introduce clang tooling to a fairly large code base with a<br>
> custom build system. The first step i wanted to take is to manually create a<br>
> compilation database file for one translation unit, and do some testing on<br>
> that.<br>
><br>
> First, i added -### to the compilation flags, so i could get the actual<br>
> compiler invocation. I took the ouput, and put it into a<br>
> compile_command.json file. At this point, everything should have worked just<br>
> fine, but it did not. My clang tool for testing is really simple, all it<br>
> does is, it tries to run a clang::SyntaxOnlyAction on the given inputs.<br>
><br>
> If i try to run my tool on the TU that's in my compilation database, i get<br>
> errors. Here's my compilation database: <a href="http://pastebin.com/6gsRHBEN" target="_blank">http://pastebin.com/6gsRHBEN</a> and<br>
> here is my output the tool gives me: <a href="http://pastebin.com/4AXfdF0r" target="_blank">http://pastebin.com/4AXfdF0r</a> I also<br>
> tried without the inner-quotes (<a href="http://pastebin.com/sWwyvbp8" target="_blank">http://pastebin.com/sWwyvbp8</a>)<u></u>, the result's<br>
> the same.<br>
><br>
> What really bugs me is that if i open a terminal, switch to the 'directory',<br>
> and copy-paste the content of the 'command' part (without JSON-escaping of<br>
> course), clang compiles the file (and generates the object file) without any<br>
> errors. Also, don't know if relevant, but the project is built using an<br>
> older xcode toolchain (based on clang 3.2), and i built my tool based on<br>
> clang 3.5. Why does my tool reject totally valid arguments, what do i do<br>
> wrong?<br>
><br>
> Thanks,<br>
> Peter<br>
><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>
><br>
<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>