03-28-2007, 11:36 AM,
|
|
alex25
Senior Member
|
Posts: 531
Threads: 42
Joined: Jun 2006
|
|
abs1nth Wrote:what about:
local_env.Append(CCFLAGS = '-include #/include/pch.h')
i've committed a fix to the build environment:
env.MergeFlags('-include pch.h')
now gcc finds the relevant header. still not convinced this whole pch.h business is worth it though.
--alex--
|
|
03-28-2007, 04:54 PM,
|
|
alex25
Senior Member
|
Posts: 531
Threads: 42
Joined: Jun 2006
|
|
thelusiv Wrote:Hmmm the MergeFlags fix doesn't seem to work for me, is that a new SCons feature? What version are you using Alex? the one that comes with debian unstable: 0.96.93.
--alex--
|
|
03-29-2007, 09:07 PM,
|
|
reece146
Member
|
Posts: 187
Threads: 26
Joined: Oct 2006
|
|
Any news about this? I'm stuck on the MergeFlags thing too...
Code: AttributeError: SConsEnvironment instance has no attribute 'MergeFlags':
File "SConstruct", line 313:
env.MergeFlags('-include pch.h')
(scons-0.96.1)
Edit: Gentoo peoples: 0.96.94 is in unstable and seems to get past this.
|
|
03-30-2007, 12:49 AM,
|
|
alex25
Senior Member
|
Posts: 531
Threads: 42
Joined: Jun 2006
|
|
abs1nth Wrote:mergeflags seems to need the latest unstable scons
try replacing
env.MergeFlags('-include pch.h')
with
env.Append(CXXFLAGS = '-include pch.h')
did you try it? on my scons it keeps adding quotes around -include pch.h and gcc won't recognize it. anyway, the more it think about this pre compiled header idea (whatever that means) the dumber i think it is. it's probably time to go back to each file including the header files it needs. just out of curiosity, how exactly did you test the compilation times when it doesn't really seem to compile for anybody?
--alex--
|
|
03-30-2007, 03:08 AM,
|
|
thelusiv
Administrator
|
Posts: 2,346
Threads: 223
Joined: Jun 2005
|
|
I think I have a fix checked into SVN. I have turned off the MergeFlags line and put
in all the files that need it.
Now, to use the precompiled header...you need to first compile it (SCons doesn't do this for you properly, yet).
This will produce a file include/pch.h.gch, and gcc/g++ will automatically pick it up and use it instead when it compiles vdrift.
As for performance, with the header pre-compiled I can't quite tell the difference at all. Either way it seems to always take my new machine about 44 seconds to compile. Perhaps it's not actually using the pre-compiled header when it is there...?
|
|
03-30-2007, 08:54 AM,
|
|
abs1nth
Senior Member
|
Posts: 358
Threads: 5
Joined: Sep 2005
|
|
alex25 Wrote:did you try it? on my scons it keeps adding quotes around -include pch.h and gcc won't recognize it. as a matter of fact i tried it and it worked fine (v0.96.92)
alex25 Wrote:anyway, the more it think about this pre compiled header idea (whatever that means) the dumber i think it is. it's probably time to go back to each file including the header files it needs. well i think multiplying hundreds of code lines is dumb ^^
the pain grew since definitions.h was added...
(i'm not talking about the multiplied system includes but the multiplied conditional macros for mac/win)
sorry for the whole mess but i couldn't forsee that it's apartently impossible to add a simple flag to gcc with (the latest stable) scons.
alex25 Wrote:just out of curiosity, how exactly did you test the compilation times when it doesn't really seem to compile for anybody? i'm using Xcode on a mac ;o)
|
|
03-30-2007, 11:08 AM,
|
|
alex25
Senior Member
|
Posts: 531
Threads: 42
Joined: Jun 2006
|
|
abs1nth Wrote:well i think multiplying hundreds of code lines is dumb
well, this is how scons or make manage dependencies by having each file include the header files it needs. change a header file and you recompile only the files that depend on it. now that everything is in one giant header, change one header file and recompile everything. i wouldn't really call this duplication of code, i would call it smart dependency management. now, if you were to read up on large scale software development i don't think you would find one person advocating putting all the header files in one giant header. on the contrary (look at unix headers, etc. even macos, since it's based on freebsd, does the same thing with the system header files).
--alex--
|
|
03-30-2007, 12:11 PM,
|
|
abs1nth
Senior Member
|
Posts: 358
Threads: 5
Joined: Sep 2005
|
|
alex25 Wrote:now that everything is in one giant header, change one header file and recompile everything. well the system headers aren't supposed to change often or at all.
of course there is the problem that we also include definitons.h (in pch.h) which changes with every svn revision, definitely a problem if we really want to precompile the header - but right now i mainly advocated the thing to get rid of the massive distribution of #ifdef __APPLE__ all over the source base. if we want to pre-compile it we have to take the include of definitions.h out of there of course, or include the REVISION in some other way.
|
|
03-30-2007, 12:29 PM,
|
|
alex25
Senior Member
|
Posts: 531
Threads: 42
Joined: Jun 2006
|
|
abs1nth Wrote:well the system headers aren't supposed to change often or at all.
they do, on a real system :wink: i track cvs/svn for a lot of the packages vdrift depends on (mesa, sdl, openal, etc). the apple stuff should've gone in some compatibility header (same with windows or unix specific stuff). for the rest, each file should include the header files in needs. let's not reinvent (badly) the wheel.
oh, and speaking of definitions.h. it shouldn't be in svn as it is automatically generated. i get a conflict every time i do an svn update but i've learned to ignore it.
--alex--
|
|
|