The cross
configuration in the Cross.toml
file, can contain the following elements:
The build
key allows you to set global variables, e.g.:
[build]
xargo = true
default-target = "x86_64-unknown-linux-gnu"
With the build.env
key you can globally set volumes that should be mounted
in the Docker container or environment variables that should be passed through.
For example:
[build.env]
volumes = ["VOL1_ARG", "VOL2_ARG"]
passthrough = ["IMPORTANT_ENV_VARIABLES"]
The target
key allows you to specify parameters for specific compilation targets.
[target.aarch64-unknown-linux-gnu]
xargo = false
image = "test-image"
runner = "custom-runner"
The target
key allows you to specify environment variables that should be used for a specific compilation target.
This is similar to build.env
, but allows you to be more specific per target.
[target.x86_64-unknown-linux-gnu.env]
volumes = ["VOL1_ARG", "VOL2_ARG"]
passthrough = ["IMPORTANT_ENV_VARIABLES"]