Skip to content

Document noncumulative target overrides #166

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 3 commits into from
Jun 12, 2017
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
14 changes: 7 additions & 7 deletions docs/advanced/config_system.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,18 +203,18 @@ 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
## Overriding target attributes

Target configurations contain a set of cumulative attributes that can be manipulated in the application configuration. These attributes can be overridden as a normal configuration parameter, or manipulated with the special `attribute_add` and `attribute_remove` meta-attributes.
Target configurations contain a set of attributes that you may manipulate with an application configuration. You may override these attributes as if they were a normal configuration parameter. If these attributes are cumulative, you may also manipulate them with the special `attribute_add` and `attribute_remove` meta-attributes.

Cumulative attributes:

- ``features``: List of features that will be compiled into the resulting binary and be available at runtime. Determines the FEATURE directories included during compilation. These are also emitted as FEATURE macros. Features cannot nest inside of other features. Features operate on a strictly add, add or remove, remove basis. If two different libraries each try to add or remove the same feature, the scan operation will report a failure.
- ``device_has``: List of hardware components available on the target. These are emitted as DEVICE_HAS macros.
- ``extra_labels``: List of target labels that 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.
- ``features``: This attribute contains a list of features that the mbed OS tools compile into the resulting binary and are available at runtime. The mbed OS tools include all code within a directory whose name is an entry of the `features` attribute prefixed with `FEATURE_`. Further, the mbed OS tools emit all entries within this attribute as macros prefixed with `FEATURE_`. If two different libraries try to add and remove the same feature, the mbed OS tools will report an error.
- ``device_has``: This attribute is a list of hardware components available on the target. The mbed OS tools emit all entries within this attribute as macros prefixed with `DEVICE_`.
- ``extra_labels``: The `extra_labels` attribute is a list of labels that the mbed OS tools use to include code. The mbed OS tools include all code within a directory whose name is an entry of the `extra_labels` attribute prefixed with `TARGET_`. The mbed OS tools also emit all entries in this attribute as macros prefixed with `TARGET_`.
- ``macros``: This attribute is a list of target-specific macros that the mbed OS tools define 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:
For example, this `mbed_app.json` disables the IPV4 feature; using this network stack will result in a compilation error:

```
{
Expand Down