aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAlex Light <allight@google.com>2018-04-17 16:50:48 -0700
committerAlex Light <allight@google.com>2018-04-24 08:15:02 -0700
commitec868fc42aefd299a2f26249f7751b3385840187 (patch)
tree8a06e0fc069662aa8ad4c648e762ff68e94bd617 /docs
parent2b8959ad5a37574226f5dbd07a027319e184f7c4 (diff)
downloadsoong-ec868fc42aefd299a2f26249f7751b3385840187.tar.gz
Add support for generating Compdb file
Some tools (i.e. you-complete-me) make use of a 'compdb' file (compile_commands.json) that records (among other things) the arguments needed to compile a file. These tools can use this with libclang to provide semantic completions and perform other IDE actions. This CL adds support for soong to generate a (simple) compile_commands.json file. Test: make SOONG_GEN_COMPDB=1 SOONG_LINK_COMPDB_TO=$ANDROID_BUILD_TOP nothing examine $ANDROID_BUILD_TOP/compile_commands.json Change-Id: I751bb344b90dfcdad1dfd71c2a85bacd345f0464
Diffstat (limited to 'docs')
-rw-r--r--docs/compdb.md27
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/compdb.md b/docs/compdb.md
new file mode 100644
index 000000000..68927ca1c
--- /dev/null
+++ b/docs/compdb.md
@@ -0,0 +1,27 @@
+# Compdb (compile\_commands.json) Generator
+
+Soong can generate compdb files. This is intended for use with editing tools
+such as YouCompleteMe and other libclang based completers.
+
+compdb file generation is enabled via environment variable:
+
+```bash
+$ export SOONG_GEN_COMPDB=1
+$ export SOONG_GEN_COMPDB_DEBUG=1
+```
+
+One can make soong generate a symlink to the compdb file using an environment
+variable:
+
+```bash
+$ export SOONG_LINK_COMPDB_TO=$ANDROID_HOST_OUT
+```
+
+You can then trigger an empty build:
+
+```bash
+$ make nothing
+```
+
+Note that if you build using mm or other limited makes with these environment
+variables set the compdb will only include files in included modules.