fidlc


The FIDL compiler

Usage: fidlc [--json JSON_PATH]
             [--available PLATFORM:VERSION]
             [--platform PLATFORM]
             [--name LIBRARY_NAME]
             [--experimental FLAG_NAME]
             [--werror]
             [--format=[text|json]]
             [--json-schema]
             [--depfile DEPFILE_PATH]
             [--files [FIDL_FILE...]...]
             [--help]

All of the arguments can also be provided via a response file, denoted as
`@responsefile`. The contents of the file at `responsefile` will be interpreted
as a whitespace-delimited list of arguments. Response files cannot be nested.

See <https://fuchsia.dev/fuchsia-src/development/languages/fidl/reference/compiler>
for more information.


OPTIONS:

  • --json JSON_PATH. If present, this flag instructs fidlc to output the library's intermediate representation at the given path. The intermediate representation is JSON that conforms to the schema available via --json-schema. The intermediate representation is used as input to the various backends.

  • --available PLATFORM:VERSION. If present, this flag instructs fidlc to compile libraries versioned under PLATFORM at VERSION, based on @available attributes. PLATFORM corresponds to a library's @available(platform="PLATFORM") attribute, or to the library name's first component if the platform argument is omitted.

  • --platform PLATFORM. If present, this flag instructs fidlc to validate that the main library being compiled is versioned under PLATFORM. The library's platform is determined as follows:

    • If there are no @available attributes, the platform is "unversioned".
    • The platform can be explicit with @available(platform="PLATFORM").
    • Otherwise, the platform is the first component of the library name.
  • --name LIBRARY_NAME. If present, this flag instructs fidlc to validate that the main library being compiled has the given name. This flag is useful to cross-check between the library's declaration in a build system and the actual contents of the library.

  • --experimental FLAG_NAME. If present, this flag enables an experimental feature of fidlc.

  • --depfile DEPFILE_PATH. Path of depfile generated by fidlc. This depfile is used to get correct incremental compilation rules. This file is populated by fidlc as Line1: out1: in1 in2 in3, Line2: out2: in1 in2 in3 ... Where out[1-2] are all the outputs generated by fidlc and in[1-3] are the files read. The input files are what are passed by --files. Output files are those generated by fidlc.

  • --files [FIDL_FILE...].... Each --files [FIDL_FILE...] chunk of arguments describes a library, all of which must share the same top-level library name declaration. Libraries must be presented in dependency order, with later libraries able to use declarations from preceding libraries but not vice versa. Output is only generated for the final library, not for each of its dependencies.

  • --json-schema. If present, this flag instructs fidlc to output the JSON schema of the intermediate representation.

  • --format=[text|json]. If present, this flag sets the output mode of fidlc. This specifies whether to output errors and warnings, if compilation fails, in plain text (the default), or as JSON.

  • --werror. Treats warnings as errors.

  • --help. Prints this help, and exit immediately.