Page 1 of 1

Shared precompiled headers

Posted: Sat Oct 15, 2011 5:12 pm
by Mikachu
Hi,

I was recently thinking about a way to further reduce compilation times of Ogre : would it be possible to share a single precompiled header between all the samples? (I mean, a precompiled header that would just include "Ogre.h")
They all include some parts of Ogre, which makes their compilation not so quick (we're talking about 30 seconds for a 100 lines of code project, there).

Has anyone got any experience about it, and know if it's feasible/has any pitfall?
When I'll get the time, I think I'll try that on my own project and see if that can apply to Ogre too.. :)

Re: Shared precompiled headers

Posted: Sat Oct 15, 2011 5:46 pm
by CABAListic
Probably not easily, but I have thought about methods to use CMake to dynamically gather all of the samples into a single project, which would hugely benefit from our Unity build method. I will try this after 1.8 is released.

Re: Shared precompiled headers

Posted: Sat Oct 15, 2011 7:07 pm
by spacegaier
I created a new feature ticket for that, with target version 1.8.1 and assigned it to CABAlistic :) .

http://www.ogre3d.org/mantis/view.php?id=470

Re: Shared precompiled headers

Posted: Thu Oct 20, 2011 11:26 pm
by CABAListic
I have reconsidered and am now trying to get this into 1.8. With the Unity build option, the Samples are essentially the most time-consuming process now, so getting this reduced would fit well for the 1.8 release. I have already gotten the basic idea working on my local repository. There are a few quirks I need to iron out before I push it, but I'm hoping that will get done over the weekend.

Compile time on my machine for the whole Ogre project is down to approx. 1:30 mins, OgreMain occupies half of that time.

Re: Shared precompiled headers

Posted: Fri Oct 21, 2011 6:12 am
by spacegaier
Wow, that sounds awesome!