News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

remove/change compiler option for a single file.

Started by Martin K., October 30, 2012, 11:37:21 AM

Previous topic - Next topic

Martin K.

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

MortenMacFly

Quote from: Martin K. on October 30, 2012, 11:37:21 AM
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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Martin K.

Quote from: MortenMacFly on October 30, 2012, 01:15:48 PM
Quote from: Martin K. on October 30, 2012, 11:37:21 AM
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