Mbed_app.json per build profile


I would like to configure certain target_overrides, such as platform.heap-stats-enabled, based on the current build profile. In debug, it is nice to include a lot of statistics, but those are not necessary in release. Plus for us, they seem to cause a problem (Malloc hang when using platform.heap-stats-enabled=true in combination with -O2/-O3)

Is there a way to achieve this build profile-dependent configuration?

Thank you

FWIW, if you use mbed-cmake, you can add the defines representing those options conditionally in the CMake build script based on build configuration. For example:


Good to know there is a potential workaround. I hope the CMake system the mbed-os devs are working on will allow something like this too.