<div dir="ltr"><div>Hello</div><div><br></div><div>I would like to introduce clang tooling to a fairly large code base with a custom build system. The first step i wanted to take is to manually create a compilation database file for one translation unit, and do some testing on that.</div><div><br></div><div>First, i added -### to the compilation flags, so i could get the actual compiler invocation. I took the ouput, and put it into a compile_command.json file. At this point, everything should have worked just fine, but it did not. My clang tool for testing is really simple, all it does is, it tries to run a clang::SyntaxOnlyAction on the given inputs.</div><div><br></div><div>If i try to run my tool on the TU that's in my compilation database, i get errors. Here's my compilation database: <a href="http://pastebin.com/6gsRHBEN">http://pastebin.com/6gsRHBEN</a> and here is my output the tool gives me: <a href="http://pastebin.com/4AXfdF0r">http://pastebin.com/4AXfdF0r</a> I also tried without the inner-quotes (<a href="http://pastebin.com/sWwyvbp8">http://pastebin.com/sWwyvbp8</a>), the result's the same.</div><div><br></div><div>What really bugs me is that if i open a terminal, switch to the 'directory', and copy-paste the content of the 'command' part (without JSON-escaping of course), clang compiles the file (and generates the object file) without any errors. Also, don't know if relevant, but the project is built using an older xcode toolchain (based on clang 3.2), and i built my tool based on clang 3.5. Why does my tool reject totally valid arguments, what do i do wrong?</div><div><br></div><div>Thanks,</div><div>Peter</div></div>