This command requires that only one target is being compiled. If more than one
target is available for the current package the filters of --lib, --bin, etc,
-must be used to select which target is compiled.
+must be used to select which target is compiled. To pass flags to all compiler
+processes spawned by Cargo, use the $RUSTFLAGS environment variable or the
+`build.rustflags` configuration option.
";
pub fn execute(options: Options, config: &Config) -> CliResult<Option<()>> {
timeout = 60000 # Timeout for each HTTP request, in milliseconds
[build]
-jobs = 1 # number of jobs to run by default (default to # cpus)
-rustc = "rustc" # the rust compiler tool
-rustdoc = "rustdoc" # the doc generator tool
-target = "triple" # build for the target triple
-target-dir = "target" # path of where to place all generated artifacts
+jobs = 1 # number of jobs to run by default (default to # cpus)
+rustc = "rustc" # the rust compiler tool
+rustdoc = "rustdoc" # the doc generator tool
+target = "triple" # build for the target triple
+target-dir = "target" # path of where to place all generated artifacts
+rustflags = ["..", ".."] # custom flags to pass to all compiler invocations
[term]
verbose = false # whether cargo provides verbose output
# Environment variables Cargo reads
-You can override these environment variables to change Cargo's behavior on your system:
+You can override these environment variables to change Cargo's behavior on your
+system:
* `CARGO_HOME` - Cargo maintains a local cache of the registry index and of git
checkouts of crates. By default these are stored under `$HOME/.cargo`, but
this variable overrides the location of this directory. Once a crate is cached
it is not removed by the clean command.
-* `CARGO_PROFILE` - If this is set to a positive integer *N*, Cargo will record
- timing data as it runs. When it exits, it will print this data as a profile
- *N* levels deep.
* `CARGO_TARGET_DIR` - Location of where to place all generated artifacts,
relative to the current working directory.
* `RUSTC` - Instead of running `rustc`, Cargo will execute this specified
compiler instead.
* `RUSTDOC` - Instead of running `rustdoc`, Cargo will execute this specified
`rustdoc` instance instead.
+* `RUSTFLAGS` - A space-separated list of custom flags to pass to all compiler
+ invocations that Cargo performs. In contrast with `cargo rustc`, this is
+ useful for passing a flag to *all* compiler instances.
+
+Note that Cargo will also read environment variables for `.cargo/config`
+configuration values, as described in [that documentation][config-env]
+
+[config-env]: config.html#environment-variables
# Environment variables Cargo sets for crates