Forum 2005-2010 (read only)
(Read 1 time)
May 06, 2010, 09:42 am
I'd like to include the "-fshort-enums" when building.
Short of recompiling the IDE, does anyone know how to pass an option to the compiler via the IDE?
May 06, 2010, 11:10 am
I just looked at the Makefile (Arduino 015) and there is this line:
CFLAGS = $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CSTANDARD) $(CEXTRA)
Where CEXTRA seems to not be set. So probably you can export that variable to your environment, ant it will be used as a flag for the compiler.
May 06, 2010, 07:43 pm
Thanks. I'll give it a spin and see what happens...
May 10, 2010, 05:08 am
No luck. The Arduino IDE doesn't use the makefile.
The code of interest is in Compiler.java / getCommandCompilerCPP method. It's clear there's no way to inject compiler options at that point. I haven't been able to find a pragma or other compiler directive to enable short-enums.
I'll have to do enums "long hand" unless someone has another suggestion. Any ideas?