summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2022-07-25 07:26:07 -0600
committerMats Wichmann <mats@linux.com>2022-07-25 07:31:53 -0600
commite4c748f70b9d006a1260595149d11c56414f9fe7 (patch)
tree702ed4a12af013011e5ddf8aff2c1ae83975a867
parent2f10fe6c285646ee0d4eb021c4ee94aed4f319c7 (diff)
downloadscons-git-e4c748f70b9d006a1260595149d11c56414f9fe7.tar.gz
Dedent some examples in userguide [ci skip]
The compilation DB examples in the User Guide are indented with the rest of the text (possibly auto-formatting by an editor), while the scons_example and programlisting XML elements respect formatting, so they should actually be dedented. Example code which is not to be displayed (just used to drive the example generation) don't matter so they were left alone this time. Signed-off-by: Mats Wichmann <mats@linux.com>
-rw-r--r--doc/user/external.xml114
1 files changed, 53 insertions, 61 deletions
diff --git a/doc/user/external.xml b/doc/user/external.xml
index 0eab32e9f..ceeece084 100644
--- a/doc/user/external.xml
+++ b/doc/user/external.xml
@@ -129,13 +129,13 @@
<scons_example name="external_cdb_ex1">
<file name="SConstruct" printme="1">
- env = Environment(COMPILATIONDB_USE_ABSPATH=True)
- env.Tool('compilation_db')
- env.CompilationDatabase()
- env.Program('hello.c')
+env = Environment(COMPILATIONDB_USE_ABSPATH=True)
+env.Tool('compilation_db')
+env.CompilationDatabase()
+env.Program('hello.c')
</file>
<file name="hello.c">
- int main( int argc, char* argv[] )
+ int main(int argc, char* argv[])
{
return 0;
}
@@ -152,14 +152,14 @@
</para>
<programlisting language="json">
- [
- {
- "command": "gcc -o hello.o -c hello.c",
- "directory": "/home/user/sandbox",
- "file": "/home/user/sandbox/hello.c",
- "output": "/home/user/sandbox/hello.o"
- }
- ]
+[
+ {
+ "command": "gcc -o hello.o -c hello.c",
+ "directory": "/home/user/sandbox",
+ "file": "/home/user/sandbox/hello.c",
+ "output": "/home/user/sandbox/hello.o"
+ }
+]
</programlisting>
<para>
@@ -202,15 +202,15 @@
<scons_example name="external_cdb_ex2">
<file name="SConstruct" printme="1">
- env = Environment()
- env.Tool('compilation_db')
- cdb = env.CompilationDatabase('compile_database.json')
- Alias('cdb', cdb)
- env.Program('test_main.c')
+env = Environment()
+env.Tool('compilation_db')
+cdb = env.CompilationDatabase('compile_database.json')
+Alias('cdb', cdb)
+env.Program('test_main.c')
</file>
<file name="test_main.c">
#include "test_main.h"
- int main( int argc, char* argv[] )
+ int main(int argc, char* argv[])
{
return 0;
}
@@ -225,23 +225,21 @@
</scons_output>
<para>
- <filename>compile_database.json</filename>
- contains:
+ <filename>compile_database.json</filename> contains:
</para>
<programlisting language="json">
- [
- {
- "command": "gcc -o test_main.o -c test_main.c",
- "directory": "/home/user/sandbox",
- "file": "test_main.c",
- "output": "test_main.o"
- }
- ]
+[
+ {
+ "command": "gcc -o test_main.o -c test_main.c",
+ "directory": "/home/user/sandbox",
+ "file": "test_main.c",
+ "output": "test_main.o"
+ }
+]
</programlisting>
<para>
-
The following (incomplete) example shows using filtering
to separate build variants.
In the case of using variants,
@@ -251,20 +249,19 @@
and 64-bit build hinted at here.
For simplicity of presentation,
the example omits the setup details of the variant directories:
-
</para>
<sconstruct>
- env = Environment()
- env.Tool('compilation_db')
+env = Environment()
+env.Tool("compilation_db")
- env1 = env.Clone()
- env1['COMPILATIONDB_PATH_FILTER'] = 'build/linux32/*'
- env1.CompilationDatabase('compile_commands-linux32.json')
+env1 = env.Clone()
+env1["COMPILATIONDB_PATH_FILTER"] = "build/linux32/*"
+env1.CompilationDatabase("compile_commands-linux32.json")
- env2 = env.Clone()
- env2['COMPILATIONDB_PATH_FILTER'] = 'build/linux64/*'
- env2.CompilationDatabase('compile_commands-linux64.json')
+env2 = env.Clone()
+env2["COMPILATIONDB_PATH_FILTER"] = "build/linux64/*"
+env2.CompilationDatabase('compile_commands-linux64.json')
</sconstruct>
<para>
@@ -273,30 +270,29 @@
</para>
<programlisting language="json">
- [
- {
- "command": "gcc -m32 -o build/linux32/test_main.o -c test_main.c",
- "directory": "/home/user/sandbox",
- "file": "test_main.c",
- "output": "build/linux32/test_main.o"
- }
- ]
+[
+ {
+ "command": "gcc -o hello.o -c hello.c",
+ "directory": "/home/mats/github/scons/exp/compdb",
+ "file": "hello.c",
+ "output": "hello.o"
+ }
+]
</programlisting>
<para>
- <filename>compile_commands-linux64.json</filename>
- contains:
+ <filename>compile_commands-linux64.json</filename> contains:
</para>
<programlisting language="json">
- [
- {
- "command": "gcc -m64 -o build/linux64/test_main.o -c test_main.c",
- "directory": "/home/user/sandbox",
- "file": "test_main.c",
- "output": "build/linux64/test_main.o"
- }
- ]
+[
+ {
+ "command": "gcc -m64 -o build/linux64/test_main.o -c test_main.c",
+ "directory": "/home/user/sandbox",
+ "file": "test_main.c",
+ "output": "build/linux64/test_main.o"
+ }
+]
</programlisting>
</section>
@@ -309,8 +305,6 @@
It is subject to change and/or removal without a depreciation cycle.
</para>
-
-
<para>
Loading the &t-link-ninja; tool into SCons will make significant changes
in SCons' normal functioning.
@@ -341,8 +335,6 @@ SetOption('experimental', 'ninja')
</example_commands>
</note>
-
-
<para>
Ninja is a small build system that tries to be fast
by not making decisions. &SCons; can at times be slow