Page 1 of 1

Truly global compiler setttings

Posted: Thu Sep 22, 2011 11:48 pm
by tankist02
I am a new user of CodeLite and so far I like it a lot.

My question - is there a place to set some global compiler options? Global means they will be applied to all my projects/configurations. For example, I like to always have -Wall and I don't want to repeat it for each project (which I have a few dozens).

All I found by searching is describing how to set "Global" settings per project and all configurations, but I need "more global" than that.

I also found:

<GlobalIncludePath/>
<GlobalLibPath/>

in .codelite/config/build_settings.xml which I might find helpful later, but I don't see how to set compiler options.

Re: Truly global compiler setttings

Posted: Fri Sep 23, 2011 7:55 am
by eranif
There are several ways to do that:
1)

Settings | Build Settings | Compilers | <Your Compiler Name> | Tools
Replace the 'C++ compiler name' or 'C compiler name' with "g++ -Wall"

2) (the recommended way)

Change it per-file type:
Settings | Build Settings | Compilers | <Your Compiler Name> | File Types
And change the build pattern per file extension.

For example, to add "-Wall" to all of your .cpp files, change the build line from:

Code: Select all

$(CompilerName) $(SourceSwitch) "$(FileFullPath)" $(CmpOptions) $(ObjectSwitch)$(IntermediateDirectory)/$(ObjectName)$(ObjectSuffix) $(IncludePath)
into:

Code: Select all

$(CompilerName) -Wall $(SourceSwitch) "$(FileFullPath)" $(CmpOptions) $(ObjectSwitch)$(IntermediateDirectory)/$(ObjectName)$(ObjectSuffix) $(IncludePath)
Eran

Re: Truly global compiler setttings

Posted: Sat Sep 24, 2011 2:02 am
by tankist02
Nice. Thanks a lot!