From e4c748f70b9d006a1260595149d11c56414f9fe7 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Mon, 25 Jul 2022 07:26:07 -0600 Subject: 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 --- doc/user/external.xml | 114 +++++++++++++++++++++++--------------------------- 1 file 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 @@ - 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') - int main( int argc, char* argv[] ) + int main(int argc, char* argv[]) { return 0; } @@ -152,14 +152,14 @@ - [ - { - "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" + } +] @@ -202,15 +202,15 @@ - 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') #include "test_main.h" - int main( int argc, char* argv[] ) + int main(int argc, char* argv[]) { return 0; } @@ -225,23 +225,21 @@ - compile_database.json - contains: + compile_database.json contains: - [ - { - "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" + } +] - 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: - - 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') @@ -273,30 +270,29 @@ - [ - { - "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" + } +] - compile_commands-linux64.json - contains: + compile_commands-linux64.json contains: - [ - { - "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" + } +] @@ -309,8 +305,6 @@ It is subject to change and/or removal without a depreciation cycle. - - Loading the &t-link-ninja; tool into SCons will make significant changes in SCons' normal functioning. @@ -341,8 +335,6 @@ SetOption('experimental', 'ninja') - - Ninja is a small build system that tries to be fast by not making decisions. &SCons; can at times be slow -- cgit v1.2.1