thelusiv Wrote:I checked something (r1561) in that sort of fixes this. Actually it's more of a trade-off. I set up an automatically generated header file "definitions.h" that now contains all the #define statements that used to be -D flags for the compiler. Now, fewer files have to be recompiled every time something changes in this file. It still is a lot...but it's not quite all of them. Let me know if you guys like this better than recompiling all the files every time a define changes.
I still find there is too much re-compile because of REVISION. So I did some searching in scons mailing archive. Here is what I've found,
http://scons.tigris.org/servlets/ReadMsg...msgNo=7893
Quote:And here's another, which may be more in line with what you were asking:
env=Environment(CPPVAR = '-flag2', CPPFLAGS = '-flag1 $CPPVAR -flag3'.split())
p = env.Program('foo',
['foo1.c',
env.Object('foo2.c', CPPVAR = '-flag4'),
'foo3.c'])
Foo2.c will be compiled with -flag4 instead of -flag2.
We can adopt the same method to add a -DREVISION="xxxx" when compiling main.cpp. This should avoid the excessive re-compile due to revision change.