Skip to content

"target_overrides" unhandy for "macros" with values #3123

@betzw

Description

@betzw

Description

  • Type: Enhancement
  • Priority: Minor

Enhancement

Reason to enhance or problem with existing solution
When trying to override the value of a macro defined in targets.json for an application in file mbed_app.json I didn't find a better way then first removing the first macro including its value and then add the macro with its new value (all my other trials either didn't work or produced ugly compiler warnings), e.g. like this:

{
    "target_overrides": {
        "*": {
           "target.macros_remove": ["TRANSACTION_QUEUE_SIZE_SPI=2"],
           "target.macros_add": ["TRANSACTION_QUEUE_SIZE_SPI=0"]
       }
    }
}

Suggested enhancement
The unfortunate things here are that we need two lines to express what we want to do and above all that we need to know also the original value of the macro. Unfortunately, this value could even be different from platform to platform, which would require to specify the overrides for each platform we are targeting in our application!
Therefore, I would propose some additional syntax like this:

{
    "target_overrides": {
        "*": {
           "target.macros_value": ["TRANSACTION_QUEUE_SIZE_SPI=0"]       
        }
    }
}

Pros

  • No need to know & specify the original value, which might be different from platform to platform
  • Simpler syntax

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions