Use crates inside `build.rs` build scripts.

Section: Dependencies

Add build dependencies

toml
toml
[build-dependencies]
cc = "1"
Explanation

Build dependencies are only available to the build script.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Dependencies
Add a crates.io dependency
Use a semantic version requirement.
OpenIn sheettomlsame section
Use a git dependency
Pin a crate directly from a Git repository.
OpenIn sheettomlsame section
Use a local path dependency
Depend on a nearby crate in a monorepo.
OpenIn sheettomlsame section
Add dev-dependencies
Keep test-only crates out of the normal build graph.
OpenIn sheettomlsame section
Build with selected features
Enable one or more package features.
OpenIn sheetbash2 tag match
Build every member
Compile all packages in the workspace.
OpenIn sheetbash2 tag match