1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
|
<?xml version="1.0"?>
<!--
MIT License
Copyright The SCons Foundation
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
-->
<!DOCTYPE sconsdoc [
<!ENTITY % scons SYSTEM '../../../doc/scons.mod'>
%scons;
<!ENTITY % builders-mod SYSTEM '../../../doc/generated/builders.mod'>
%builders-mod;
<!ENTITY % functions-mod SYSTEM '../../../doc/generated/functions.mod'>
%functions-mod;
<!ENTITY % tools-mod SYSTEM '../../../doc/generated/tools.mod'>
%tools-mod;
<!ENTITY % variables-mod SYSTEM '../../../doc/generated/variables.mod'>
%variables-mod;
]>
<sconsdoc xmlns="http://www.scons.org/dbxsd/v1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">
<tool name="ninja">
<summary>
<para>
Sets up the &b-link-Ninja; builder, which generates a &ninja; build file, and then optionally runs &ninja;.
</para>
<note>
<para>This is an experimental feature.
This functionality is subject to change and/or removal without a deprecation cycle.
</para>
</note>
</summary>
<sets>
<item>NINJA_DISABLE_AUTO_RUN</item>
<item>NINJA_ALIAS_NAME</item>
<item>NINJA_DIR</item>
<item>NINJA_COMPDB_EXPAND</item>
<item>NINJA_ENV_VAR_CACHE</item>
<item>NINJA_FILE_NAME</item>
<item>NINJA_GENERATED_SOURCE_SUFFIXES</item>
<item>NINJA_GENERATED_SOURCE_ALIAS_NAME</item>
<item>NINJA_MSVC_DEPS_PREFIX</item>
<item>NINJA_DEPFILE_PARSE_FORMAT</item>
<item>NINJA_POOL</item>
<item>NINJA_REGENERATE_DEPS</item>
<item>NINJA_SYNTAX</item>
<item>NINJA_FORCE_SCONS_BUILD</item>
<item>_NINJA_REGENERATE_DEPS_FUNC</item>
<!-- <item>__NINJA_NO</item>-->
<item>IMPLICIT_COMMAND_DEPENDENCIES</item>
<item>NINJA_SCONS_DAEMON_KEEP_ALIVE</item>
<item>NINJA_SCONS_DAEMON_PORT</item>
<!-- TODO: Document these -->
<!-- <item>NINJA_RULES</item>-->
<!-- <item>NINJA_POOLS</item>-->
<!-- <item>NINJA</item>-->
<!-- <item>GENERATING_NINJA</item>-->
<!-- <item>NINJA_DIR</item>-->
</sets>
<uses>
<item>AR</item>
<item>ARCOM</item>
<item>ARFLAGS</item>
<item>CC</item>
<item>CCCOM</item>
<item>CCDEPFLAGS</item>
<item>CCFLAGS</item>
<item>CXX</item>
<item>CXXCOM</item>
<item>ESCAPE</item>
<item>LINK</item>
<item>LINKCOM</item>
<item>PLATFORM</item>
<item>RANLIB</item>
<item>RANLIBCOM</item>
<item>SHCCCOM</item>
<item>SHCXXCOM</item>
<item>SHLINK</item>
<item>SHLINKCOM</item>
<item>PROGSUFFIX</item>
<item>PRINT_CMD_LINE_FUNC</item>
<!--<item>TEMPFILE</item>-->
<!-- TODO: Document these -->
<!-- <item>NINJA_MAX_JOBS</item> -->
<!-- <item>NINJA_SKIP</item> -->
<!-- <item>NINJA_CUSTOM_HANDLERS</item> -->
</uses>
</tool>
<builder name="Ninja">
<summary>
<para>
A special builder which
adds a target to create a Ninja build file.
The builder does not require any source files to be specified.
</para>
<note>
<para>This is an experimental feature. To enable it you must use one of the following methods
</para>
<!-- NOTE DO NOT INDENT example_commands CONTENTS AS IT WILL ALTER THE FORMATTING-->
<example_commands>
# On the command line
--experimental=ninja
# Or in your SConstruct
SetOption('experimental', 'ninja')
</example_commands>
<para>This functionality is subject to change and/or removal without deprecation cycle.</para>
<para>
To use this tool you need to install the &Python; &ninja; package,
as the tool by default depends on being able to do an
<systemitem>import</systemitem> of the package
<!-- (although see &cv-link-__NINJA_NO;).-->
This can be done via:
<example_commands>
python -m pip install ninja
</example_commands>
</para>
</note>
<para>
If called with no arguments,
the builder will default to a target name of
<filename>ninja.build</filename>.
</para>
<para>
If called with a single positional argument,
&scons; will "deduce" the target name from that source
argument, giving it the same name, and then
ignore the source.
This is the usual way to call the builder if a
non-default target name is wanted.
</para>
<para>
If called with either the
<parameter>target=</parameter>
or <parameter>source=</parameter> keyword arguments,
the value of the argument is taken as the target name.
If called with both, the
<parameter>target=</parameter>
value is used and <parameter>source=</parameter> is ignored.
If called with multiple sources,
the source list will be ignored,
since there is no way to deduce what the intent was;
in this case the default target name will be used.
</para>
<para>
<emphasis>Available since &scons; 4.2.</emphasis>
</para>
</summary>
</builder>
<cvar name="NINJA_GENERATED_SOURCE_SUFFIXES">
<summary>
<para>
The list of source file suffixes which are generated by &SCons; build steps.
All source files which match these suffixes will be added to the _generated_sources alias in the output
&ninja; build file.
Then all other source files will be made to depend on this in the &ninja; build file, forcing the
generated sources to be built first.
</para>
</summary>
</cvar>
<cvar name="NINJA_GENERATED_SOURCE_ALIAS_NAME">
<summary>
<para>
A string matching the name of a user defined alias which represents a list of all generated sources.
This will prevent the auto-detection of generated sources from &cv-NINJA_GENERATED_SOURCE_SUFFIXES;.
Then all other source files will be made to depend on this in the &ninja; build file, forcing the
generated sources to be built first.
</para>
</summary>
</cvar>
<cvar name="NINJA_MSVC_DEPS_PREFIX">
<summary>
<para>
The <parameter>msvc_deps_prefix</parameter> string.
Propagates directly into the generated &ninja; build file.
From Ninja's docs:
<quote>defines the string which should be stripped from msvc's <option>/showIncludes</option> output</quote>
</para>
</summary>
</cvar>
<cvar name="NINJA_DEPFILE_PARSE_FORMAT">
<summary>
<para>
Determines the type of format ninja should expect when parsing header
include depfiles. Can be <option>msvc</option>, <option>gcc</option>, or <option>clang</option>.
The <option>msvc</option> option corresponds to <option>/showIncludes</option> format, and
<option>gcc</option> or <option>clang</option> correspond to <option>-MMD -MF</option>.
</para>
</summary>
</cvar>
<cvar name="NINJA_DIR">
<summary>
<para>
The <parameter>builddir</parameter> value.
Propagates directly into the generated &ninja; build file.
From Ninja's docs:
<quote>
A directory for some Ninja output files. ... (You can also store other build output in this
directory.)
</quote>
The default value is <filename>.ninja</filename>.
</para>
</summary>
</cvar>
<cvar name="NINJA_REGENERATE_DEPS">
<summary>
<para>
A generator function used to create a &ninja; depfile which
includes all the files which would require
&SCons; to be invoked if they change.
Or a list of said files.
</para>
</summary>
</cvar>
<cvar name="NINJA_COMPDB_EXPAND">
<summary>
<para>
Boolean value to instruct &ninja; to expand the command line arguments normally put into
response files.
If true, prevents unexpanded lines in the compilation database like
<quote><literal>gcc @rsp_file</literal></quote> and instead yields expanded lines like
<quote><literal>gcc -c -o myfile.o myfile.c -Ia -DXYZ</literal></quote>.
</para>
<para>
Ninja's compdb tool added the <option>-x</option> flag in Ninja V1.9.0
</para>
</summary>
</cvar>
<cvar name="NINJA_ENV_VAR_CACHE">
<summary>
<para>
A string that sets the environment for any environment variables that
differ between the OS environment and the &SCons; execution environment.
</para>
<para>
It will be compatible with the default shell of the operating system.
</para>
<para>
If not explicitly set, &SCons; will generate this dynamically from the
execution environment stored in the current &consenv;
(e.g. <literal>env['ENV']</literal>)
where those values differ from the existing shell..
</para>
</summary>
</cvar>
<cvar name="NINJA_POOL">
<summary>
<para>
Set the <parameter>ninja_pool</parameter> for this or all targets in scope for this env var.
</para>
</summary>
</cvar>
<cvar name="NINJA_DISABLE_AUTO_RUN">
<summary>
<para>
Boolean. Default: <constant>False</constant>.
If true, &SCons; will not run &ninja; automatically after creating the &ninja; build file.
</para>
<para>
If not explicitly set, this will be set to <constant>True</constant>
if <option>--disable_execute_ninja</option> or
<code>SetOption('disable_execute_ninja', True)</code> is seen.
</para>
</summary>
</cvar>
<!-- Internal for now
<cvar name="__NINJA_NO">
<summary>
<para>
Internal flag. Used to tell &SCons; whether or not to try to import the &Python; &ninja; module.
This is set to True when being called by Ninja?
</para>
</summary>
</cvar>
-->
<cvar name="NINJA_FILE_NAME">
<summary>
<para>
The filename for the generated Ninja build file.
The default is <filename>ninja.build</filename>.
</para>
</summary>
</cvar>
<cvar name="NINJA_ALIAS_NAME">
<summary>
<para>
The name of the alias target which will cause &SCons; to create the &ninja; build file,
and then (optionally) run &ninja;.
The default value is <literal>generate-ninja</literal>.
</para>
</summary>
</cvar>
<cvar name="NINJA_SYNTAX">
<summary>
<para>
The path to a custom <filename>ninja_syntax.py</filename> file which is used in generation.
The tool currently assumes you have &ninja; installed as a &Python; module and grabs the syntax file from that
installation if &cv-NINJA_SYNTAX; is not explicitly set.
</para>
</summary>
</cvar>
<cvar name="NINJA_FORCE_SCONS_BUILD">
<summary>
<para>
If true, causes the build nodes to callback to scons instead of using
&ninja; to build them. This is intended to be passed to the environment on the builder invocation.
It is useful if you have a build node which does something which is not easily translated into &ninja;.
</para>
</summary>
</cvar>
<cvar name="_NINJA_REGENERATE_DEPS_FUNC">
<summary>
<para>
Internal value used to specify the function to call with argument env to generate the list of files
which if changed would require the &ninja; build file to be regenerated.
</para>
</summary>
</cvar>
<cvar name="NINJA_SCONS_DAEMON_KEEP_ALIVE">
<summary>
<para>
The number of seconds for the SCons deamon launched by ninja to stay alive.
(Default: 180000)
</para>
</summary>
</cvar>
<cvar name="NINJA_SCONS_DAEMON_PORT">
<summary>
<para>
The TCP/IP port for the SCons daemon to listen on.
<emphasis>NOTE: You cannot use a port already being listened to on your build machine.</emphasis>
(Default: random number between 10000,60000)
</para>
</summary>
</cvar>
</sconsdoc>
|