Skip to content

[docs] Added documentation over the cumulative attributes #2279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 28, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/config_system.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,28 @@ Other than this, `target_overrides` works exactly like it does for libraries. Ke

It is an error for the application configuration to override configuration parameters that were not defined.

## Overriding cumulative target attributes

Target configurations contain a set of cumulative attributes that can be manipulated in the application configuration. These attributes can be overriden as a normal configuration parameter, or manipulated with the special `attribute_add` and `attribute_remove` meta-attributes.

Cumulative attributes:
- features: List of features which will be compiled into the resulting binary and available at runtime. Determines the FEATURE directories included during compilation. These are also emitted as FEATURE macros.
- device_has: List of hardware components available on the target. These are emitted as DEVICE_HAS macros.
- extra_labels: List of target labels which determine the TARGET directories included during compilation. These are also emitted as TARGET macros.
- macros: List of target-specific macros that are defined during compilation.

For example, an application may want to remove features with extra space or runtime cost. This `mbed_app.json` will disable the IPV4 network stack. Attempting to use this network stack will result in a compilation error:

```
{
"target_overrides": {
"K64F": {
"target.features_remove": ["IPV4"]
}
}
}
```

## Custom targets

Application configuration can optionally define application-specific targets. These are mbed targets that are needed just to compile this specific application, so it doesn't make sense to add them to the list of official mbed targets; on the contrary, since they're part of `mbed_app.json`, they're versioned together with the application and only known by the application. Application-specific targets are defined with the key `custom_targets` in the `mbed_app.json` file and have the same syntax as a regular target definition, for example:
Expand Down