Getting compile_commands.json from clang#
The clang compiler has an option that can be used to create elements of the compile_commands.json:
clang++ -MJ a.o.json -Wall -std=c++11 -o a.o -c a.cpp clang++ -MJ b.o.json -Wall -std=c++11 -o b.o -c b.cpp
You can then combine all the individual json files into one compile_commands.json, as described in the link below: