News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Setting different Build Options for an individual file

Started by ChuckH, March 17, 2011, 02:30:27 PM

Previous topic - Next topic

ChuckH

I'm a Code::Blocks newbie doing AVR embedded development using the WinAVR (gcc) toolchain.

Question:  I know how to set Build Options for the build target but I haven't been able to figure out how to set Build Options for an individual file.

For example:  With -O (optimize) selected for the target in general how do I turn this option off for a specific file?

In my case I need to compile most of the files with -O on so that the code will fit in the processor but I need to compile one file with no -O option to make debugging (W/AVRStudio 4) easier.

Thanks, Chuck Hackett

oBFusCATed

Right click on the file -> properties -> advanced...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

ChuckH

Quote from: oBFusCATed on March 17, 2011, 03:22:40 PM
Right click on the file -> properties -> advanced...

Thanks, I was looking for the same kind of "append these options" action that is provided for targets but this works fine.

Took me a minute to realize that I needed to enter the entire 'default' compiler directive "$compiler $options $includes -c $file -o object" as noted below the "custom build" text box.

Thanks for the help  :D

Chuck Hackett