1*333d2b36SAndroid Build Coastguard Worker# Compdb (compile\_commands.json) Generator 2*333d2b36SAndroid Build Coastguard Worker 3*333d2b36SAndroid Build Coastguard WorkerSoong can generate compdb files. This is intended for use with editing tools 4*333d2b36SAndroid Build Coastguard Workersuch as YouCompleteMe and other libclang based completers. 5*333d2b36SAndroid Build Coastguard Worker 6*333d2b36SAndroid Build Coastguard Workercompdb file generation is enabled via environment variable: 7*333d2b36SAndroid Build Coastguard Worker 8*333d2b36SAndroid Build Coastguard Worker```bash 9*333d2b36SAndroid Build Coastguard Worker$ export SOONG_GEN_COMPDB=1 10*333d2b36SAndroid Build Coastguard Worker$ export SOONG_GEN_COMPDB_DEBUG=1 11*333d2b36SAndroid Build Coastguard Worker``` 12*333d2b36SAndroid Build Coastguard Worker 13*333d2b36SAndroid Build Coastguard WorkerOne can make soong generate a symlink to the compdb file using an environment 14*333d2b36SAndroid Build Coastguard Workervariable: 15*333d2b36SAndroid Build Coastguard Worker 16*333d2b36SAndroid Build Coastguard Worker```bash 17*333d2b36SAndroid Build Coastguard Worker$ export SOONG_LINK_COMPDB_TO=$ANDROID_HOST_OUT 18*333d2b36SAndroid Build Coastguard Worker``` 19*333d2b36SAndroid Build Coastguard Worker 20*333d2b36SAndroid Build Coastguard WorkerYou can then trigger an empty build: 21*333d2b36SAndroid Build Coastguard Worker 22*333d2b36SAndroid Build Coastguard Worker```bash 23*333d2b36SAndroid Build Coastguard Worker$ make nothing 24*333d2b36SAndroid Build Coastguard Worker``` 25*333d2b36SAndroid Build Coastguard Worker 26*333d2b36SAndroid Build Coastguard WorkerNote that if you build using mm or other limited makes with these environment 27*333d2b36SAndroid Build Coastguard Workervariables set the compdb will only include files in included modules. 28