How to Use Overrides for Static Library Build?

Hi there - I am trying to enable floating point formatting in the minimal-printf library during a build of a static archive of mbed-os.

I am able to follow the instructions from the minimal-printf repo when building an application (using mbed_app.json), however I am unable to get the same configuration changes when building my archive.

The command I use to build my static archive:
mbed compile --library --source=mbed-os -m SFE_ARTEMIS_DK -t GCC_ARM

How may I enable floating point formatting using the minimal-printf library within a static archive build of mbed?

related github issue

Thanks a bunch!

Can anyone offer insight into this? I am struggling to find the information on my own. Thank you

Hi

this should help:

Regards
Anna

Hello Anna,

I really appreciate that you took the time to respond to me.

You might notice that I linked to the same README file in my original post. I am able to use the “target_overrides” property in mbed_app.json when building an application (which includes the ‘main’ function definition). My trouble instead comes when I try to achieve the same override when building Mbed as a static library. The mbed_app.json in the project root no longer seems to be respected, nor do a few other locations I have tried. (Such as in the mbed-os dir itself).

Is there supposed to be a difference between overrides when compiling an app vs a static library?

See, it won’t do to modify ‘mbed_config.h’ after the fact because the library will have been compiled not to support the printf features I need. Any modifications to the config header are replaced by the auto-generated file when the build is run again.

If you can offer any additional advice it would be wonderful.

Best,
Owen