<br><br><div class="gmail_quote">On Wed, Oct 24, 2012 at 11:30 PM, Bill White <span dir="ltr"><<a href="mailto:bill.white@griggsinst.com" target="_blank">bill.white@griggsinst.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm trying to understand how to make a compile database.  I can't switch to<br>
cmake because my very large project uses gmake.  So I've made a python<br>
program to create a compile_commands.json file.  It seems to have the right<br>
information.  For one file, named "x/y.cpp", when I cut the "command" value<br>
out of the compile_commands.json file for "x/y.cpp" and execute it in a shell,<br>
the command executes as I expect it to.  However, when I try to run<br>
"clang-check"<br>
I get various odd errors.  Here's the complete situation:<br>
<br>
1.) The compile_commands.json file is in /a/b/c/compile_commands.json.  I<br>
    Think that makes "/a/b/c" the build directory in clang Tooling terms.<br>
2.) The source file is in /a/b/c/x/y.cpp.<br>
3.) The entry in compile_comands.json is:<br>
        {"directory": "/a/b/c", "command": "clang++ x/y.cpp ... stuff<br>
...", "file": "/a/b/c/x/y.cpp"}<br>
    And of course there are many entries.  This is just one of hundreds.<br></blockquote><div>Do you separate them with commas and put brackets around the whole construct? I.e., does your file look like this:</div></div>
<blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_quote"><div><font face="courier new, monospace">[</font></div></div><div class="gmail_quote"><div><font face="courier new, monospace">        {"directory": "/a/b/c/x", "command": "clang++ x/y.cpp ... ", "file": "/a/b/c/x/y.cpp"},</font></div>
</div><div class="gmail_quote"><div><div><font face="courier new, monospace">        {"directory": "/a/b/c/x", "command": "clang++ x/z.cpp ... ", "file": "/a/b/c/x/z.cpp"}</font></div>
</div></div><div class="gmail_quote"><div><font face="courier new, monospace">]</font></div></div></blockquote><div class="gmail_quote"><div><span style="font-family:arial,helvetica,sans-serif">?</span></div><div><span style="font-family:arial,helvetica,sans-serif"><br>
</span></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
When I run clang-check, as the documentation seems to imply, using -p to name<br>
the build directory, I get this:<br>
<br>
% cd /a/b/c<br>
% clang-check -p . x/y.cpp<br>
Processing: /a/b/c/x/y.cpp.<br>
error: no input files<br>
error: unable to handle compilation, expected exactly one compiler job in ''<br>
Error while processing /a/b/c/x/y.cpp.<br>
<br>
Note: I get the same behavior putting the full path name for ".", when eliminate<br>
      the "-p build_dir" completely.  I also get the same behavior<br>
when I cd into<br>
      x and run the experiments (with y.cpp in place of x/y.cpp, of course).<br>
<br>
Why am I being so dense about this?  What am I missing?  This seems very<br>
unintuitive.  I'm trying to build a tool which extracts dependence<br>
information, but<br>
I'm stymied right at the beginning.<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">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/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div><font color="#666666"><span style="border-top-width:2px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(213,15,37);border-right-color:rgb(213,15,37);border-bottom-color:rgb(213,15,37);border-left-color:rgb(213,15,37);padding-top:2px;margin-top:2px">Alexander Kornienko |</span><span style="border-top-width:2px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(51,105,232);border-right-color:rgb(51,105,232);border-bottom-color:rgb(51,105,232);border-left-color:rgb(51,105,232);padding-top:2px;margin-top:2px"> Software Engineer |</span></font><span style="border-top-width:2px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(0,153,57);border-right-color:rgb(0,153,57);border-bottom-color:rgb(0,153,57);border-left-color:rgb(0,153,57);padding-top:2px;margin-top:2px"><font color="#666666"> </font><a href="mailto:alexfh@google.com" style="color:rgb(17,85,204)" target="_blank">alexfh@google.com</a> |</span><span style="border-top-width:2px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(238,178,17);border-right-color:rgb(238,178,17);border-bottom-color:rgb(238,178,17);border-left-color:rgb(238,178,17);padding-top:2px;margin-top:2px"> <a value="+35315435283" style="color:rgb(17,85,204)">+49 151 221 77 957</a></span></div>
</div><div><font color="#666666"><span style="background-color:rgb(255,255,255);font-family:Arial,Verdana,sans-serif">Google Germany GmbH | </span><span style="background-color:rgb(255,255,255);font-family:Arial,Verdana,sans-serif">Dienerstr. 12 | </span><span style="background-color:rgb(255,255,255);font-family:Arial,Verdana,sans-serif">80331 München</span></font></div>
<br>