Author Topic: remove/change compiler option for a single file.  (Read 4061 times)

Offline Martin K.

  • Multiple posting newcomer
  • *
  • Posts: 86
remove/change compiler option for a single file.
« on: October 30, 2012, 11:37:21 am »
Hello Code:Blocks Gurus,

I want to change a compiler option for a single file. As far as i know, i have to use a custom build command for this. but how?
The problem is a project (Visual Studio Compiler) with precompiled headers enabled. This is Option "/Yu"stdafx.h". But on file doesn't have stdafx.h included, so i have to remove this option. Setting additional options in a custom build command is easy, but removing one? Any Ideas?

Thanks
Martin

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: remove/change compiler option for a single file.
« Reply #1 on: October 30, 2012, 01:15:48 pm »
Setting additional options in a custom build command is easy, but removing one? Any Ideas?
In the file properties you can do this - right click on a file in a project and select properties, then look into the options.

But careful: You can screw the build process if you do it wrong.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Martin K.

  • Multiple posting newcomer
  • *
  • Posts: 86
Re: remove/change compiler option for a single file.
« Reply #2 on: October 30, 2012, 01:27:50 pm »
Setting additional options in a custom build command is easy, but removing one? Any Ideas?
In the file properties you can do this - right click on a file in a project and select properties, then look into the options.

But careful: You can screw the build process if you do it wrong.

Hi,

Ich have found this option already, but i don't know what to do than.
Something like "$compiler [[ removeoption($options) ]]  $includes -c $file -o $object" i think, but how?

Sorry, i'm not a "squirrel" man currently.
Martin