The clang compilation database (compile_commands.json) is a json file that has instructions on how to compile your file. If your project uses soong, you can follow the instructions here
However, if your project does not yet build with soong, you can use bear to generate it from make files on Android.
- Install Bear
- Create an
incremental_build.sh
script with the following contents and put it somwhere, like in~/bin
|
|
- Run the following on the target you’d like the
compile_commands.json
for, for example - you can do the following for surfaceflinger
|
|