Global preprocessor settings

General questions regarding the usage of CodeLite
koolgraph
CodeLite Curious
Posts: 2
Joined: Sun Feb 26, 2012 10:45 am
Genuine User: Yes
IDE Question: C++
Contact:

Global preprocessor settings

Post by koolgraph »

Hi, I searched all over the IDE and never found something like a Workspace global pre-processors options or an IDE's global. I searched the web for a macro defined natively by Codelite to identify itself like MSVC or C::B but found nothing.

That would be really helpful so if someone can lead me to something or a workaround to do the same thing, that would be really appreciated
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Global preprocessor settings

Post by eranif »

A workaround can be achieved by making a new toolchain from: settings -> build settings -> Compilers -> New...

Create a clone of the g++ toolchain, and name it something 'g++ with macro'
Now, edit the newly created compiler and add the macros to the toolchain you want:

so instead of 'C++ compiler name': g++
it now becomes: g++ -DMYMACRO

Right click your project and select 'settings' and update the compiler In the "Common Settings => General" with the new one


From this point on, everytime you modify the toolchain it will affect all projects that are using it

You can also submit feature request at source forge
Eran
Make sure you have read the HOW TO POST thread
koolgraph
CodeLite Curious
Posts: 2
Joined: Sun Feb 26, 2012 10:45 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Global preprocessor settings

Post by koolgraph »

Thanks for the reply, i had done something like this and it seemed not to work. I must have done something wrong, i'll try again.

Thanks again.
Post Reply