Variable Block

The variable block defines a variable that can be provided using the commandline.

Example Usage

# define config variable - the default value is used if not provided via --variable
variable config {
  description = "configuration to build"
  default = "Debug"
}

Argument Reference

The following arguments are supported:

  • description - (Optional) Description of the variable.
  • default - (Optional) Default value for the variable. It must evaluate to scalar if provided.

Variable override

Variables must be declared in WORKSPACE.

Terrabuild supports variable overriding using this order (first one wins):

  1. Environment variable: use TB_VAR_xxx to override a variable (with xxx the variable name).
  2. Command line argument: use --variable switch when building a target.
Last updated on