Skip to content

Commit

Permalink
Update documentation for dynouts
Browse files Browse the repository at this point in the history
  • Loading branch information
HampusAdolfsson committed Dec 22, 2023
1 parent 5005467 commit 6a51ecf
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
14 changes: 9 additions & 5 deletions doc/manual.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ each of them with a missing include error or equivalent pointing to the
generated file.
_Available since Ninja 1.11._
`outputs`:: list all outputs of the build graph. This includes any dynamic
outputs stored in the deps log.
`recompact`:: recompact the `.ninja_deps` file. _Available since Ninja 1.4._
`restat`:: updates all recorded file modification timestamps in the `.ninja_log`
Expand Down Expand Up @@ -899,11 +902,12 @@ keys.
stored as `.ninja_deps` in the `builddir`, see <<ref_toplevel,the
discussion of `builddir`>>.

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

`msvc_deps_prefix`:: _(Available since Ninja 1.5.)_ defines the string
which should be stripped from msvc's /showIncludes output. Only
Expand Down
10 changes: 8 additions & 2 deletions src/graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ struct EdgeCmp {

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

/// ImplicitDepLoader loads implicit dependencies, as referenced via the
/// "depfile" attribute in build files.
/// ImplicitDepLoader loads implicit dependencies and outputs, as referenced via
/// the "depfile" and "dynout" attributes in build files.
struct ImplicitDepLoader {
ImplicitDepLoader(State* state, DepsLog* deps_log,
DiskInterface* disk_interface,
Expand All @@ -290,6 +290,10 @@ struct ImplicitDepLoader {
/// @return false on error (without filling \a err if info is just missing
// or out of date).
bool LoadDeps(Edge* edge, std::string* err);

/// Load implicit outputs for \a edge.
/// @return false on error (without filling \a err if info is just missing
// or out of date).
bool LoadImplicitOutputs(Edge* edge, std::string* err);

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

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

/// Preallocate \a count spaces in the input array on \a edge, returning
Expand Down
2 changes: 1 addition & 1 deletion src/ninja.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ const Tool* ChooseTool(const string& tool_name) {
Tool::RUN_AFTER_LOGS, &NinjaMain::ToolQuery },
{ "targets", "list targets by their rule or depth in the DAG",
Tool::RUN_AFTER_LOAD, &NinjaMain::ToolTargets },
{ "outputs", "list all outputs of the build graph, include dynamic outputs if there are any and they have been built.",
{ "outputs", "list all outputs of the build graph, including dynamic outputs stored in the deps log",
Tool::RUN_AFTER_LOGS, &NinjaMain::ToolOutputs },
{ "compdb", "dump JSON compilation database to stdout",
Tool::RUN_AFTER_LOAD, &NinjaMain::ToolCompilationDatabase },
Expand Down

0 comments on commit 6a51ecf

Please sign in to comment.