Configuring the Cargo.toml file to add crates

Chromium has a single set of centrally-managed direct crate dependencies. These are managed through a single Cargo.toml:

  1. [dependencies]
  2. bitflags = "1"
  3. cfg-if = "1"
  4. cxx = "1"
  5. # lots more...

As with any other Cargo.toml, you can specify more details about the dependencies —- most commonly, you’ll want to specify the features that you wish to enable in the crate.

When adding a crate to Chromium, you’ll often need to provide some extra information in an additional file, gnrt_config.toml, which we’ll meet next.