petersohn
petersohn

Reputation: 11730

How to set compiler options in Arduino Eclipse IDE?

I installed the Arduino Eclipse plugin, and created a new project. I want to compile my code with the -std=c++11 option, but by default Eclipse does not use that option. Under Project Properties, for other C++ projects build options can be set in the C++ Build tab, but it is missing for my Arduino project. Is there any way to set the build options?

Upvotes: 2

Views: 851

Answers (1)

Greycon
Greycon

Reputation: 789

I recently installed this plugin, and I wanted to do the same thing, in order to generate mixed C and Assembler listing. In summary, (This is for OSX, you will have to figure out the paths if you are on a different platform.)

  1. Look in /Users/concunningham/.arduinocdt/packages/arduino/hardware/avr/1.6.23 for a file called platform.txt.
  2. In there you will find a line like this: compiler.cpp.extra_flags=-Wa,-adhln -g > "$<".lst

You can see I added "-Wa,-adhln -g > "$<".lst" as extra options for the cpp compiler.

Now, this is key - restart Eclipse, clean the project in question, and rebuild. You should see your extra options take effect. Peep at the makefile to be sure.

Upvotes: 1

Related Questions