only pass -DNSIS_VERSION to files that actually use it

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4067 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2005-06-17 14:03:22 +00:00
parent 2a45f49a20
commit 7bd448c4ff

View file

@ -72,9 +72,23 @@ conf.Finish()
#env['PCH'] = env.PCH(pch)[0]
#env['PCHSTOP'] = pch
##### Defines
##### Version define
env.Append(CPPDEFINES = ['NSIS_VERSION=v$NSIS_VERSION'])
version_env = env.Copy()
version_env.Append(CPPDEFINES = ['NSIS_VERSION=v$VERSION'])
# only pass -DNSIS_VERSION to files that use it to minimize rebuilds
new_makensis_files = []
for file in makensis_files:
f = File(file).srcnode().abspath
if open(f).read().find('NSIS_VERSION') >= 0:
new_makensis_files.append(version_env.Object(file))
else:
new_makensis_files.append(file)
makensis_files = new_makensis_files
##### LZMA specific defines