Skip to content

Commit 4d8cbdc

Browse files
authored
Merge pull request #2279 from geky/docs-ca
[docs] Added documentation over the cumulative attributes
2 parents dbd43bb + 38cd901 commit 4d8cbdc

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docs/config_system.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,28 @@ Other than this, `target_overrides` works exactly like it does for libraries. Ke
201201

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

204+
## Overriding cumulative target attributes
205+
206+
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.
207+
208+
Cumulative attributes:
209+
- 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.
210+
- device_has: List of hardware components available on the target. These are emitted as DEVICE_HAS macros.
211+
- extra_labels: List of target labels which determine the TARGET directories included during compilation. These are also emitted as TARGET macros.
212+
- macros: List of target-specific macros that are defined during compilation.
213+
214+
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:
215+
216+
```
217+
{
218+
"target_overrides": {
219+
"K64F": {
220+
"target.features_remove": ["IPV4"]
221+
}
222+
}
223+
}
224+
```
225+
204226
## Custom targets
205227

206228
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:

0 commit comments

Comments
 (0)