I am trying to attach a -Ddisable_simple_fns option to the compiler command that arduino IDE generates automatically. Is there a way to do it? Thanks. It would be nice to have this hack "custom def" in arduino IDE although I don't know how to.
[Edit]: The solution appears to require either visual studio plugin or arduino 1.5 and creating new board def in boards.txt with a "board_name.build.extra_flags=-Dsomething=value".
Hey, i'm using 1.5.1r2 I cannot find a 'platforms.txt',
I also had a browse through the IDE preferences ( C:\Users\Chris\AppData\Roaming\Arduino ) but no luck. Would be very nice if I could change the optimisation levels.
Any locations I should be looking in?
EDIT: windows search is blind ( the machine's fault not the user ), it was in "D:\arduino-1.5.1r2\hardware\arduino\avr"
It's in the exeFolder/hardware/arduino/avr and can work in conjunction with the new properties in the 1.5 boards.txt
Alternatively if you want it to work with 1.0.x formats then the visual studio plugin allows any number of -D defines via the project property "Defines - Project"
But 1.5 might be the simplest route unless you also want intellisense etc and are using windows.
I've only recently started with 1.5 so can't recall exactly but I think you can add your own overrides and "recipe" patterns directly to the boards.txt. You will find the default settings and recipe patterns in the platform.txt. Example:-
recipe.cpp.o.pattern=
So this would mean you could copy a board def in the boards.txt, change the name to whatever you want and add your own recipe specifically for your new board definition. This would allow you to optionally invoke your additional compiler defines just by switching board. (I hope this info is correct)
If you have vs installed then it is certainly easier to achieve this with the vs plugin, which also allows us to set a -D list on a per configuration basis. This means, for example, that we can have a -D list for "My Normal Compile" and a list for "My Special Compile" etc.
Below is a duplicate called Arduino Uno 2. Notice that each property for the board starts with a unique id, in this case "uno2". So to copy a def you only need to set the .name property and ensure that each entry starts with a unique id of your choice.
Thanks. I added a new line phi_panel.build.extra_flags=-Ddisable_simple_fns to a new board def I copied and changed and it did the trick, according to the verbose output. I wonder if I can do phi_panel.build.extra_flags=-DXX=10 with the defined number instead of just defining a name. Will try later.