[sldev] Precompiled headers

Carsten Juttner carjay at gmx.net
Mon Apr 21 12:20:23 PDT 2008


Hi,

tried using precompiled headers for a Linux gcc build.

I just made a rough comparison with previous compile times but the 
speedup seems to be around 20-25%.

If newview/llviewerprecompiledheaders.h is to be used for all files (and 
not just the newview directory) then 2 patches are currently necessary.

First, llcommon/lltimer.cpp includes timing.h for some reason which 
defines global time conversion constants differently. But since this 
file is marked as "deprecated" I think that is just some cleanup work 
not done yet.

The second issue is that the header of libpng does not like a previous 
inclusion of setjmp.h and it seems to be pulled in by the precompiled 
header along the way. This can be prevented by simply adding the 
libpng-header to the precompiled header.

Apart from that (and a problem that probably only concerns my build 
since I converted most of the internal static libs to
dynamic libs and the -fPIC-flag is only present for dynamic libs so I'd 
need to create 2 different precompiled headers for these 2 cases) it 
builds (and runs) fine.

SCons seems not to support precompiled headers (I created them more or 
less manually) and the last time I needed it, CMake only had a way to 
set up the headers for Visual Studio but not for gcc. So it's probably 
not that easy to generally enable without making some additions to the 
scripts.

But maybe something to keep in mind for the cmake branch.

Regards,
Carsten



More information about the SLDev mailing list