build

vb build [OPTIONS] TARGETS

Description

Invoke the build tool for TARGETS. If targets are unspecified, builds the default target.

Options

-C DIR

Change to DIR before doing anything else

-f FILE

Input build file [default=build.ninja]

-j N

Run N jobs in parallel (0 means infinity)

-k N

Keep going until N jobs fail (0 means infinity) [default=1]

-l N

Do not start new jobs if the load average is greater than N

-n

Dry run (don’t run commands but act like they succeeded)

-d MODE

Enable debugging (use -d list to list modes)

-t TOOL

Run a subtool (use -t list to list subtools). Terminates toplevel options; further flags are passed to the tool

-w FLAG

Adjust warnings (use -w list to list warnings)

--quiet

Don’t show progress status, just command output

See Also

See also

gn

Examples

  • Dry-run a minimal build using a local build.ninja

$ vb sys echo -e "rule echo\n  command = echo hello > hello.txt\nbuild hello.txt: echo\n" > build.ninja
$ vb build -n -f build.ninja hello.txt
[1/1] echo hello > hello.txt
  • Run a build from an output directory

$ vb sys mkdir out
$ vb sys echo -e "rule touch\n  command = echo done > out.txt\nbuild out.txt: touch\n" > out/build.ninja
$ vb build -C out -n
ninja: Entering directory `out'
[1/1] echo done > out.txt