Back to Comprehensive Rust

Configuring the `Cargo.toml` file to add crates

src/chromium/adding-third-party-crates/configuring-cargo-toml.md

latest854 B
Original Source
<!-- Copyright 2023 Google LLC SPDX-License-Identifier: CC-BY-4.0 -->

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:

toml
[dependencies]
bitflags = "1"
cfg-if = "1"
cxx = "1"
# lots more...

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

When adding a crate to Chromium, you'll frequently need to provide additional information in an additional file, gnrt_config.toml, which we'll meet next.