Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: ChuckH on March 17, 2011, 02:30:27 pm

Title: Setting different Build Options for an individual file
Post by: ChuckH on March 17, 2011, 02:30:27 pm
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
Title: Re: Setting different Build Options for an individual file
Post by: oBFusCATed on March 17, 2011, 03:22:40 pm
Right click on the file -> properties -> advanced...
Title: Re: Setting different Build Options for an individual file
Post by: ChuckH on March 17, 2011, 11:48:24 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