Short version: Can someone point me to an example of how the boards.txt and/or platform.txt file can be modified to reflect a menu choice for compiler optimization, either for a given board or for all of them?
Longer version: I'd like to be able to select between -Os and -O3 (at the moment) when compiling for ESP8266. I see from an Arduino wiki that there is a structure to the boards and platform files and I can see how this is reflected in the ESP-specific files. The platform.txt file looks like the spot where the options could be set, e.g. something like this
compiler.optimize_flags=-O3
compiler.optimize_flags.size=-Os
followed by something like this
compiler.c.flags=-c {compiler.warning_flags} {compiler.optimize_flags} -g -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -falign-functions=4 -MMD -std=gnu99 -ffunction-sections -fdata-sections
What seems to be escaping me is how to get this carried over to a menu option, which seems to be governed by the boards.txt info.
Can anyone provide any pointers or examples on the best way to achieve this that would survive updates? Am I even thinking about this correctly (ie. are there compiler flags for the lx106 versions of gcc and g++ that aren't recognize or don't make sense to try to use for the ESP?)
Thanks in advance,
mconsidine