summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2020-05-27 01:55:24 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2020-05-27 01:56:13 (GMT)
commit897e738e626f528618ff3c2f97e67767d2644fdf (patch)
treece1fa9f88dfbd8690877a0f8573daf795307c998
parent8c28b830c282acd4338bc4c250f04854cce1dada (diff)
downloadSCons-897e738e626f528618ff3c2f97e67767d2644fdf.zip
SCons-897e738e626f528618ff3c2f97e67767d2644fdf.tar.gz
SCons-897e738e626f528618ff3c2f97e67767d2644fdf.tar.bz2
[ci skip] Add initial section for Users Guide misc section for compilation database
-rw-r--r--doc/user/misc.xml42
1 files changed, 42 insertions, 0 deletions
diff --git a/doc/user/misc.xml b/doc/user/misc.xml
index b093629..f2531b6 100644
--- a/doc/user/misc.xml
+++ b/doc/user/misc.xml
@@ -675,4 +675,46 @@ env.Command('directory_build_info',
</section>
+ <section>
+ <title>Creating LLVM Compilation Database</title>
+
+ <para>
+
+ LLVM has defined a JSON Compilation Database Format. This file is in common use as input into LLVM tools and many IDE's and editors as well.
+ </para>
+ <para>
+ See <ulink url="https://clang.llvm.org/docs/JSONCompilationDatabase.html"><citetitle>JSON Compilation Database Format Specification¶</citetitle></ulink> for complete information
+ </para>
+
+ <para>
+
+ Currently SCons supports two variations. One is to output source and target files with paths relative to the top of the SCons build, or to output those files with their absolute path.
+ </para>
+ <para>This is controlled by <envar>COMPILATIONDB_USE_ABSPATH=(True|False)</envar></para>
+
+ <para>Example of absolute paths for target and source</para>
+ <programlisting language="json">
+[
+ {
+ "command": "gcc -o test_main.o -c test_main.c",
+ "directory": "/home/user/sandbox",
+ "file": "/home/user/sandbox/test_main.c",
+ "target": "/home/user/sandbox/test_main.o"
+ }
+]
+ </programlisting>
+ <para>Example of relative paths for target and source</para>
+
+ <programlisting language="json">
+[
+ {
+ "command": "gcc -o test_main.o -c test_main.c",
+ "directory": "/home/user/sandbox",
+ "file": "test_main.c",
+ "target": "test_main.o"
+ }
+]
+ </programlisting>
+
+ </section>
</chapter>