fx build

Run Ninja to build Fuchsia

usage: fx build [options] [LABELS_OR_TARGETS]... [-- NINJA_OPTIONS...]

Builds a set of GN or Ninja targets after performing a few correctness checks for
the Fuchsia build. Ninja-specific options must be provided after a -- specifier.

LABELS_OR_TARGETS is a list of Ninja target path, GN labels (beginning with //)
or `--toolchain=NAME` options or related aliases (see below). For example, the
following lines are equivalent ways to ask for the host `zbi` tool to be built:

   fx build --host //zircon/tools/zbi
   fx build --host //zircon/tools/zbi:zbi
   fx build --toolchain=//build/toolchain:host_x64 //zircon/tools/zbi
   fx build '//zircon/tools/zbi(//build/toolchain:host_x64)'
   fx build host_x64/zbi

The first line above is favored. Using the last line will print a warning
instructing the user which (optional) toolchain option + label to use instead.

optional arguments:
  -h, --help               Print this message. Use '-- --help' to print
                           Ninja-specific help.

  --no-checks              Disable consistency checks (for fx development only).

  --log LOGFILE            Print debug information to LOGFILE. Please attach
                           the resulting file when reporting bugs.

  --fint-params-path PATH  Path to a fint params file used by an infra
                           builder. This is useful for reproducing the exact
                           set of targets built by the infrastructure.
                           All other options listed below are ignored in this mode.

  --toolchain=TOOLCHAIN    Specify the current GN toolchain suffix to use for
                           GN labels that appear after this option.

  -j <count>               Specify an explicit max job count for both Ninja
                           and Bazel.

  --verbose                Print extra information, such as the list of
                           Ninja targets corresponding to the input GN labels
                           to build. This does *not* enable Ninja --verbose flag,
                           use '-- --verbose' to do that.

  --host                   Alias for --toolchain=host
  --default                Alias for --toolchain=default
  --fuchsia                Alias for --toolchain=fuchsia
  --fidl                   Alias for --toolchain=fidl

  -- [ARGS...]             Pass all following arguments directly to Ninja.

  --help-toolchains        Print list of valid TOOLCHAIN values.

Run `fx build -h` to see Ninja argument details.

build source code