fix bug #2497148 - allow out of tree builds on POSIX platforms
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5921 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
a1671db5d6
commit
f41ba95bab
12 changed files with 57 additions and 20 deletions
24
SConstruct
24
SConstruct
|
@ -178,11 +178,22 @@ if 'NSIS_CONFIG_CONST_DATA_PATH' in defenv['NSIS_CPPDEFINES']:
|
|||
defenv.Append(NSIS_CPPDEFINES = [('PREFIX_CONF', '"%s"' % defenv.subst('$PREFIX_CONF'))])
|
||||
defenv.Append(NSIS_CPPDEFINES = [('PREFIX_DATA', '"%s"' % defenv.subst('$PREFIX_DATA'))])
|
||||
|
||||
# Need this early for the config header files to be placed in
|
||||
if defenv['DEBUG']:
|
||||
defenv.Replace(BUILD_PREFIX = 'build/debug')
|
||||
else:
|
||||
defenv.Replace(BUILD_PREFIX = 'build/release')
|
||||
|
||||
defenv.Replace(BUILD_CONFIG = defenv.subst('$BUILD_PREFIX/config'))
|
||||
|
||||
# ensure the config directory exists
|
||||
defenv.Execute(Mkdir(defenv.Dir('#$BUILD_CONFIG')))
|
||||
|
||||
# write configuration into sconf.h and defines.h
|
||||
sconf_h = open(File('#Source/exehead/sconf.h').abspath, 'w')
|
||||
sconf_h = open(defenv.File('#$BUILD_CONFIG/nsis-sconf.h').abspath, 'w')
|
||||
sconf_h.write('// This file is automatically generated by SCons\n// DO NOT EDIT THIS FILE\n')
|
||||
|
||||
defines_h = open(File('#Source/defines.h').abspath, 'w')
|
||||
defines_h = open(defenv.File('#$BUILD_CONFIG/nsis-defines.h').abspath, 'w')
|
||||
defines_h.write('// This file is automatically generated by SCons\n// DO NOT EDIT THIS FILE\n')
|
||||
|
||||
for i in defenv['NSIS_CPPDEFINES']:
|
||||
|
@ -199,7 +210,7 @@ sconf_h.close()
|
|||
defines_h.close()
|
||||
|
||||
# write version into version.h
|
||||
f = open(File('#Source/version.h').abspath, 'w')
|
||||
f = open(defenv.File('#$BUILD_CONFIG/nsis-version.h').abspath, 'w')
|
||||
f.write('// This file is automatically generated by SCons\n// DO NOT EDIT THIS FILE\n')
|
||||
f.write('#define NSIS_VERSION "v%s"\n' % defenv['VERSION'])
|
||||
f.close()
|
||||
|
@ -322,13 +333,8 @@ defenv.TestScript = TestScript
|
|||
####### Environments ###
|
||||
######################################################################
|
||||
|
||||
if defenv['DEBUG']:
|
||||
defenv.Replace(BUILD_PREFIX = 'build/debug')
|
||||
else:
|
||||
defenv.Replace(BUILD_PREFIX = 'build/release')
|
||||
|
||||
if defenv['MSTOOLKIT']:
|
||||
defenv.Tool('mstoolkit', toolpath = ['SCons/Tools'])
|
||||
defenv.Tool('mstoolkit', toolpath = [Dir('SCons/Tools').rdir()])
|
||||
|
||||
defenv.Append(CCFLAGS = Split('$APPEND_CCFLAGS'))
|
||||
defenv.Append(LINKFLAGS = Split('$APPEND_LINKFLAGS'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue