precompiled headers

General questions regarding the usage of CodeLite
Dahman
CodeLite Curious
Posts: 3
Joined: Mon Oct 20, 2008 12:34 pm
Contact:

precompiled headers

Post by Dahman »

Hi,
How about using precompiled headers with codelite?
Thanks

Dahman
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: precompiled headers

Post by eranif »

Hi,

Since I dont use precompiled headers (causes sometimes weird bugs ...), I never took the time to implement this functionality within CodeLite.

If you can describe here, how would u like to see it, I might (and probably will...) do it ;)

Eran
Make sure you have read the HOW TO POST thread
Dahman
CodeLite Curious
Posts: 3
Joined: Mon Oct 20, 2008 12:34 pm
Contact:

Re: precompiled headers

Post by Dahman »

Thanks for the fast replay.

Well, I think that an easy way is the ability to tell CodeLite that some header file has to be compiled before all the other files on the same project.
That is: I open a menu on the header file - I check some flag (this is a precompiled header or whatever) and CodeLite and the compiler do the rest, compiling the header file and creating the .pch file.
I don't need anything else :)

Thanks

Dahman
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: precompiled headers

Post by eranif »

Until I will implement this officially, you can do this:

1. right click on the project and select 'settings'
2. select the last tab 'Custom Makefile Step'
3. There are 2 text fields there, in the first one entr the name of the gch file you want to create, for example:

Code: Select all

my_precompile_header.h.gch
NOTE: All paths are relative to the project path, by project path, I mean the location of the relevant .project

and in the dependencies text field, enter this (<TAB> should be replaced with actual TAB character:

Code: Select all

my_precompile_header.h.gch: my_precompile_header.h
<TAB>$(CompilerName) my_precompile_header.h $(CmpOptions) $(IncludePath)
Close the settings dialog, and build your project, you can see that CodeLite created a gch file from the header file

Eran
Make sure you have read the HOW TO POST thread
Dahman
CodeLite Curious
Posts: 3
Joined: Mon Oct 20, 2008 12:34 pm
Contact:

Re: precompiled headers

Post by Dahman »

Nice. For now it's good enough for me.
By the way, very nice IDE.

Thanks
Dahman
Post Reply