Bear is a tool that generates a compilation database for clang tooling.
https://github.com/rizsotto/Bear