Author Topic: Setting different Build Options for an individual file  (Read 3076 times)

Offline ChuckH

  • Single posting newcomer
  • *
  • Posts: 3
Setting different Build Options for an individual file
« 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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Setting different Build Options for an individual file
« Reply #1 on: March 17, 2011, 03:22:40 pm »
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!]

Offline ChuckH

  • Single posting newcomer
  • *
  • Posts: 3
Re: Setting different Build Options for an individual file
« Reply #2 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