Skip to content

Commit 6a51ecf

Browse files
Update documentation for dynouts
1 parent 5005467 commit 6a51ecf

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

doc/manual.asciidoc

+9-5
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ each of them with a missing include error or equivalent pointing to the
306306
generated file.
307307
_Available since Ninja 1.11._
308308
309+
`outputs`:: list all outputs of the build graph. This includes any dynamic
310+
outputs stored in the deps log.
311+
309312
`recompact`:: recompact the `.ninja_deps` file. _Available since Ninja 1.4._
310313
311314
`restat`:: updates all recorded file modification timestamps in the `.ninja_log`
@@ -899,11 +902,12 @@ keys.
899902
stored as `.ninja_deps` in the `builddir`, see <<ref_toplevel,the
900903
discussion of `builddir`>>.
901904

902-
`dynout`:: path to an optional _dynout file_ that contains the list
903-
of outputs generated by the rule. The dynout file syntax except one
904-
path per line. This is to make Ninja aware of dynamic outputs, so
905-
the command is re-run if the some dynamic outputs are missing, and
906-
dynamic outputs are clean when using `-t clean` tool.
905+
`dynout`:: path to an optional _dynout file_ that contains extra _implicit
906+
outputs_ generated by the rule. This allows ninja to dynamically discover
907+
output files whose presence is decided during the build, so that for
908+
subsequent builds the edge is re-run if some dynamic output is missing, and
909+
dynamic outputs are cleaned when using the `-t clean` tool. The dynout file
910+
syntax expects one path per line.
907911

908912
`msvc_deps_prefix`:: _(Available since Ninja 1.5.)_ defines the string
909913
which should be stripped from msvc's /showIncludes output. Only

src/graph.h

+8-2
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ struct EdgeCmp {
277277

278278
typedef std::set<Edge*, EdgeCmp> EdgeSet;
279279

280-
/// ImplicitDepLoader loads implicit dependencies, as referenced via the
281-
/// "depfile" attribute in build files.
280+
/// ImplicitDepLoader loads implicit dependencies and outputs, as referenced via
281+
/// the "depfile" and "dynout" attributes in build files.
282282
struct ImplicitDepLoader {
283283
ImplicitDepLoader(State* state, DepsLog* deps_log,
284284
DiskInterface* disk_interface,
@@ -290,6 +290,10 @@ struct ImplicitDepLoader {
290290
/// @return false on error (without filling \a err if info is just missing
291291
// or out of date).
292292
bool LoadDeps(Edge* edge, std::string* err);
293+
294+
/// Load implicit outputs for \a edge.
295+
/// @return false on error (without filling \a err if info is just missing
296+
// or out of date).
293297
bool LoadImplicitOutputs(Edge* edge, std::string* err);
294298

295299
DepsLog* deps_log() const {
@@ -311,6 +315,8 @@ struct ImplicitDepLoader {
311315
/// @return false on error (without filling \a err if info is just missing).
312316
bool LoadDepsFromLog(Edge* edge, std::string* err);
313317

318+
/// Load implicit outputs for \a edge from the DepsLog.
319+
/// @return false on error (without filling \a err if info is just missing).
314320
bool LoadOutputsFromLog(Edge* edge, std::string* err);
315321

316322
/// Preallocate \a count spaces in the input array on \a edge, returning

src/ninja.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ const Tool* ChooseTool(const string& tool_name) {
11921192
Tool::RUN_AFTER_LOGS, &NinjaMain::ToolQuery },
11931193
{ "targets", "list targets by their rule or depth in the DAG",
11941194
Tool::RUN_AFTER_LOAD, &NinjaMain::ToolTargets },
1195-
{ "outputs", "list all outputs of the build graph, include dynamic outputs if there are any and they have been built.",
1195+
{ "outputs", "list all outputs of the build graph, including dynamic outputs stored in the deps log",
11961196
Tool::RUN_AFTER_LOGS, &NinjaMain::ToolOutputs },
11971197
{ "compdb", "dump JSON compilation database to stdout",
11981198
Tool::RUN_AFTER_LOAD, &NinjaMain::ToolCompilationDatabase },

0 commit comments

Comments
 (0)