Ubuntu Manpages

cargo-build

Compile the current package

cargo build [OPTIONS]

Compile a local package and all of its dependencies.

If the --package argument is given, then SPEC is a package id specification which indicates which package should be built. If it is not given, then the current package is built. For more information on SPEC and its format, see the "cargo help pkgid" command.

Compilation can be configured via the use of profiles which are configured in the manifest. The default profile for this command is dev, but passing the --release flag will use the release profile instead.

Print this message.
Package to build.
Number of parallel jobs, defaults to # of CPUs.
Build only this package's library.
Build only the specified binary.
Build only the specified example.
Build only the specified test target.
Build only the specified benchmark target.
Build artifacts in release mode, with optimizations.
Build all available features.
Space-separated list of features to also build.
Do not build the default feature.
Build for the target triple.
Path to the Cargo.toml to compile.
Use verbose output.
No output printed to stdout.
Coloring: auto, always, never.

Build a local package and all of its dependencies

$ cargo build

Build a package with optimizations

$ cargo build --release

cargo(1)

This work is dual-licensed under Apache 2.0 and MIT terms. See COPYRIGHT file in the cargo source distribution.