Truly global compiler setttings

General questions regarding the usage of CodeLite
tankist02
CodeLite Veteran
Posts: 56
Joined: Thu Sep 22, 2011 11:29 pm
Genuine User: Yes
IDE Question: c++
Contact:

Truly global compiler setttings

Post 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.
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Truly global compiler setttings

Post 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
Make sure you have read the HOW TO POST thread
tankist02
CodeLite Veteran
Posts: 56
Joined: Thu Sep 22, 2011 11:29 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: Truly global compiler setttings

Post by tankist02 »

Nice. Thanks a lot!
Post Reply