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