Forums

Full Version: precompiled prefix header
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
after the release has been made, would you be interested to consider using a global header file for all external includes?

i've tried it out today and here are the results:
- cuts about 500 lines of redundant code
- reduces compilation time from 22 to 18 secs and further down to 12 when precompiling the prefix header (these are for a debug build on my machine)

in case you are interested i've uploaded the patches:
new include/pch.h file:
http://pastebin.ca/407011
svn diff for include directory:
http://pastebin.ca/407015
svn diff for src directly:
http://pastebin.ca/407020

you'd also need to modify the scons scripts to pass "-include include/pch.h" to gcc ...
I'm all for cutting down on redundancy. Are there any possible ill side-effects we may run into? I'm trying to imagine some but not coming up with much. I'm thinking this is probably a pretty good idea. Any thoughts, Joe (or anyone else)?
can't think of any.
i actually expected the build time to go up when not precompiling the prefix header, but that doesn't happen, on the contrary.

also since it modifies also things in vamos it might make syncing with upstream more difficult, but it seems you aren't planning to resync with them anyway (is vamos still under development?) and we have already diverged quite much here.
As far as I know Sam (Vamos author) hasn't done anything with it in almost two years. Last I heard from him he was very busy and didn't have much time for it anymore. I'm pretty sure we're the only relatively large project that uses it. And yes, we have made a few changes to the Vamos code by now.

Now that you mention it...I have been thinking about setting up a Vamos SVN repository and using the svn external feature to grab it when people check out VDrift. This might encourage other developers to use Vamos more which means more people contributing back to the library. Another idea which might actually be much better would be to work some of the lower-level stuff in VDrift back into Vamos (or some new library containing it and more stuff) which would ultimately be more useful than Vamos by itself. This is a big digressional tangent that has nothing to do with your quetsion...and will need some more discussion before any of that happens.

So my point is, don't worry about Vamos too much in this respect, making changes is OK. Smile
reducing compile times sounds good to me....
so should i just commit this to trunk?
Sure, go ahead.
ok commited hope everything is alright

don't forget:
>you'd also need to modify the scons scripts to pass "-include include/pch.h" to gcc ...
abs1nth Wrote:ok commited hope everything is alright

don't forget:
>you'd also need to modify the scons scripts to pass "-include include/pch.h" to gcc ...

nothing compiles anymore. can we please fix it?

--alex--
alex25 Wrote:nothing compiles anymore. can we please fix it?

i'm sure someone will fix the SConstruct files soon enough
*looks around*

where's thelusiv? :-)

if it doesn't get fixed by tomorrow I'll give it a shot, but we probably don't want that....
abs1nth Wrote:i'm sure someone will fix the SConstruct files soon enough

huh?! shouldn't whoever broke it fix it? just wondering...

--alex--
guess fixing it would need something like inserting

local_env.Append(CCFLAGS = '-include ../include/pch.h')

at line 72 in src/SConscript

but thats just a wild guess ;-)
That didn't work, and I've tried quite a few other methods like adding it to the SConstruct but for some reason, no matter what it always says it can't find the file. However if I just add a
Code:
#include "pch.h"
to the files that complain about it, it's fine. abs1nth, is this going to mess up your build system somehow?
thelusiv Wrote:That didn't work, and I've tried quite a few other methods like adding it to the SConstruct but for some reason, no matter what it always says it can't find the file.

what about:
local_env.Append(CCFLAGS = '-include #/include/pch.h')

thelusiv Wrote:to the files that complain about it, it's fine. abs1nth, is this going to mess up your build system somehow?

should be fine ;-)
Pages: 1 2 3