2.5 / Scons | Building on 64bit Windows
* add preliminary support for building Blender on 64bit Windows with _msvc_. The SConstruct should automatically detect if you are on a 64bit Windows and if you have that 64bit build is assumed. If you're not, 32bit build is assumed. NOTE: this is still very much wip, so your mileage may vary. Do please report on b25 taskforce ML in case of trouble. NOTE2: many of the libs are being linked in statically NOTE3: hopefully I didn't break anything for other build platforms (mingw, linux, osx). NOTE4: comes after NOTE3
This commit is contained in:
51
SConstruct
51
SConstruct
@@ -29,6 +29,13 @@
|
||||
# Set up some custom actions and target/argument handling
|
||||
# Then read all SConscripts and build
|
||||
|
||||
import platform as pltfrm
|
||||
|
||||
if pltfrm.architecture()[0] == '64bit':
|
||||
bitness = 64
|
||||
else:
|
||||
bitness = 32
|
||||
|
||||
import sys
|
||||
import os
|
||||
import os.path
|
||||
@@ -132,14 +139,17 @@ if cxx:
|
||||
env['CXX'] = cxx
|
||||
|
||||
if env['CC'] in ['cl', 'cl.exe'] and sys.platform=='win32':
|
||||
platform = 'win32-vc'
|
||||
if bitness == 64:
|
||||
platform = 'win64-vc'
|
||||
else:
|
||||
platform = 'win32-vc'
|
||||
elif env['CC'] in ['gcc'] and sys.platform=='win32':
|
||||
platform = 'win32-mingw'
|
||||
|
||||
env.SConscriptChdir(0)
|
||||
|
||||
crossbuild = B.arguments.get('BF_CROSS', None)
|
||||
if crossbuild and platform!='win32':
|
||||
if crossbuild and platform not in ('win32-vc', 'win64-vc'):
|
||||
platform = 'linuxcross'
|
||||
|
||||
env['OURPLATFORM'] = platform
|
||||
@@ -183,7 +193,7 @@ if env['BF_NO_ELBEEM'] == 1:
|
||||
env['CCFLAGS'].append('-DDISABLE_ELBEEM')
|
||||
|
||||
if env['WITH_BF_OPENMP'] == 1:
|
||||
if env['OURPLATFORM']=='win32-vc':
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||
env['CCFLAGS'].append('/openmp')
|
||||
env['CPPFLAGS'].append('/openmp')
|
||||
env['CXXFLAGS'].append('/openmp')
|
||||
@@ -283,7 +293,7 @@ if 'blenderlite' in B.targets:
|
||||
env['BF_NO_ELBEEM'] = True
|
||||
env['WITH_BF_PYTHON'] = False
|
||||
|
||||
if env['WITH_BF_SDL'] == False and env['OURPLATFORM'] in ('win32-vc', 'win32-ming'):
|
||||
if env['WITH_BF_SDL'] == False and env['OURPLATFORM'] in ('win32-vc', 'win32-ming', 'win64-vc'):
|
||||
env['PLATFORM_LINKFLAGS'].remove('/ENTRY:mainCRTStartup')
|
||||
env['PLATFORM_LINKFLAGS'].append('/ENTRY:main')
|
||||
|
||||
@@ -390,7 +400,7 @@ thestatlibs, thelibincs = B.setup_staticlibs(env)
|
||||
thesyslibs = B.setup_syslibs(env)
|
||||
|
||||
if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']:
|
||||
env.BlenderProg(B.root_build_dir, "blender", dobj + mainlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
|
||||
env.BlenderProg(B.root_build_dir, "blender", dobj , [], mainlist + thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
|
||||
if env['WITH_BF_PLAYER']:
|
||||
playerlist = B.create_blender_liblist(env, 'player')
|
||||
env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer')
|
||||
@@ -471,7 +481,6 @@ if env['OURPLATFORM']=='linux2':
|
||||
if '.svn' in tn:
|
||||
tn.remove('.svn')
|
||||
for f in tf:
|
||||
print ">>>", env['BF_INSTALLDIR'], tp, f
|
||||
iconlist.append(tp+os.sep+f)
|
||||
icontargetlist.append(env['BF_INSTALLDIR']+tp[19:]+os.sep+f)
|
||||
|
||||
@@ -496,7 +505,6 @@ for tp, tn, tf in os.walk('release/plugins'):
|
||||
if '.svn' in tn:
|
||||
tn.remove('.svn')
|
||||
for f in tf:
|
||||
print ">>>", env['BF_INSTALLDIR'], tp, f
|
||||
pluglist.append(tp+os.sep+f)
|
||||
plugtargetlist.append(env['BF_INSTALLDIR']+tp[7:]+os.sep+f)
|
||||
|
||||
@@ -540,14 +548,20 @@ elif env['OURPLATFORM']=='linux2':
|
||||
else:
|
||||
allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall]
|
||||
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw'):
|
||||
dllsources = ['${LCGDIR}/gettext/lib/gnu_gettext.dll',
|
||||
'${BF_PNG_LIBPATH}/libpng.dll',
|
||||
'${BF_ZLIB_LIBPATH}/zlib.dll',
|
||||
'${BF_TIFF_LIBPATH}/${BF_TIFF_LIB}.dll']
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc'):
|
||||
if env['OURPLATFORM'] == 'win64-vc':
|
||||
dllsources = []
|
||||
else:
|
||||
dllsources = ['${LCGDIR}/gettext/lib/gettext.dll',
|
||||
'${BF_PNG_LIBPATH}/libpng.dll',
|
||||
'${BF_ZLIB_LIBPATH}/zlib.dll',
|
||||
'${BF_TIFF_LIBPATH}/${BF_TIFF_LIB}.dll']
|
||||
dllsources += ['${BF_PTHREADS_LIBPATH}/${BF_PTHREADS_LIB}.dll']
|
||||
if env['WITH_BF_SDL']:
|
||||
dllsources.append('${BF_SDL_LIBPATH}/SDL.dll')
|
||||
if env['OURPLATFORM'] == 'win64-vc':
|
||||
pass # we link statically already to SDL on win64
|
||||
else:
|
||||
dllsources.append('${BF_SDL_LIBPATH}/SDL.dll')
|
||||
if env['WITH_BF_PYTHON']:
|
||||
dllsources.append('#release/windows/extra/python25.zip')
|
||||
dllsources.append('#release/windows/extra/zlib.pyd')
|
||||
@@ -556,7 +570,10 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw'):
|
||||
else:
|
||||
dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_LIB}.dll')
|
||||
if env['WITH_BF_ICONV']:
|
||||
dllsources += ['${BF_ICONV_LIBPATH}/iconv.dll']
|
||||
if env['OURPLATFORM'] == 'win64-vc':
|
||||
pass # we link statically to iconv on win64
|
||||
else:
|
||||
dllsources += ['${BF_ICONV_LIBPATH}/iconv.dll']
|
||||
if env['WITH_BF_FFMPEG']:
|
||||
dllsources += ['${LCGDIR}/ffmpeg/lib/avcodec-51.dll',
|
||||
'${LCGDIR}/ffmpeg/lib/avformat-52.dll',
|
||||
@@ -601,12 +618,6 @@ Default(B.program_list)
|
||||
if not env['WITHOUT_BF_INSTALL']:
|
||||
Default(installtarget)
|
||||
|
||||
#------------ RELEASE
|
||||
# TODO: zipup the installation
|
||||
|
||||
#------------ BLENDERPLAYER
|
||||
# TODO: build stubs and link into blenderplayer
|
||||
|
||||
#------------ EPYDOC
|
||||
if env['WITH_BF_DOCS']:
|
||||
SConscript('source/blender/python/api2_2x/doc/SConscript')
|
||||
|
2
extern/bullet2/src/SConscript
vendored
2
extern/bullet2/src/SConscript
vendored
@@ -7,7 +7,7 @@ Import('env')
|
||||
defs = 'USE_DOUBLES QHULL _LIB'
|
||||
cflags = []
|
||||
|
||||
if env['OURPLATFORM']=='win32-vc':
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||
defs += ' WIN32 NDEBUG _WINDOWS _LIB'
|
||||
#cflags += ['/MT', '/W3', '/GX', '/O2', '/Op']
|
||||
cflags += ['/MT', '/W3', '/GX', '/Og', '/Ot', '/Ob1', '/Op', '/G6']
|
||||
|
2
extern/solid/SConscript
vendored
2
extern/solid/SConscript
vendored
@@ -6,7 +6,7 @@ Import('env')
|
||||
defs = 'USE_DOUBLES QHULL _LIB'
|
||||
cflags = []
|
||||
|
||||
if env['OURPLATFORM']=='win32-vc':
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||
defs += ' WIN32 NDEBUG _WINDOWS _LIB'
|
||||
cflags += ['/MT', '/W3', '/GX', '/Og', '/Ot', '/Ob1', '/Op', '/G6']
|
||||
elif env['OURPLATFORM']=='win32-mingw':
|
||||
|
@@ -14,7 +14,7 @@ if window_system in ('linux2', 'openbsd3', 'sunos5', 'freebsd6', 'irix6'):
|
||||
for f in pf:
|
||||
sources.remove('intern' + os.sep + f + 'Win32.cpp')
|
||||
sources.remove('intern' + os.sep + f + 'Carbon.cpp')
|
||||
elif window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross'):
|
||||
elif window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc'):
|
||||
for f in pf:
|
||||
sources.remove('intern' + os.sep + f + 'X11.cpp')
|
||||
sources.remove('intern' + os.sep + f + 'Carbon.cpp')
|
||||
@@ -27,6 +27,6 @@ else:
|
||||
Exit()
|
||||
|
||||
incs = '. ../string ' + env['BF_OPENGL_INC']
|
||||
if window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross'):
|
||||
if window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc'):
|
||||
incs = env['BF_WINTAB_INC'] + ' ' + incs
|
||||
env.BlenderLib ('bf_ghost', sources, Split(incs), defines=['_USE_MATH_DEFINES'], libtype=['intern'], priority = [40] )
|
||||
|
@@ -55,7 +55,7 @@ if env['WITH_BF_BULLET']:
|
||||
if env['BF_NO_ELBEEM']:
|
||||
defs += ' DISABLE_ELBEEM'
|
||||
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross'):
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
|
||||
incs += ' ' + env['BF_PTHREADS_INC']
|
||||
|
||||
env.BlenderLib ( libname = 'bf_blenkernel', sources = sources, includes = Split(incs), defines = Split(defs), libtype=['core'], priority = [165] )
|
||||
|
@@ -19,7 +19,7 @@ if env['OURPLATFORM'] == 'linux2':
|
||||
cflags='-pthread'
|
||||
incs += ' ../../../extern/binreloc/include'
|
||||
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross'):
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
|
||||
incs += ' ' + env['BF_PTHREADS_INC']
|
||||
|
||||
env.BlenderLib ( 'bf_blenlib', sources, Split(incs), Split(defs), libtype=['core'], priority = [180], compileflags =cflags )
|
||||
|
@@ -14,6 +14,7 @@ to kill any code duplication
|
||||
|
||||
"""
|
||||
|
||||
import os
|
||||
import os.path
|
||||
import string
|
||||
import glob
|
||||
@@ -99,9 +100,7 @@ def create_blender_liblist(lenv = None, libtype = None):
|
||||
sortlist.sort()
|
||||
for sk in sortlist:
|
||||
v = curlib[sk]
|
||||
target = root_build_dir + 'lib/'+lenv['LIBPREFIX'] + v + lenv['LIBSUFFIX']
|
||||
if not (root_build_dir[0]==os.sep or root_build_dir[1]==':'):
|
||||
target = '#'+target
|
||||
target = os.path.abspath(os.getcwd() + os.sep + root_build_dir + 'lib' + os.sep +lenv['LIBPREFIX'] + v + lenv['LIBSUFFIX'])
|
||||
lst.append(target)
|
||||
|
||||
return lst
|
||||
@@ -145,7 +144,7 @@ def setup_staticlibs(lenv):
|
||||
if lenv['WITH_BF_PYTHON'] and lenv['WITH_BF_STATICPYTHON']:
|
||||
statlibs += Split(lenv['BF_PYTHON_LIB_STATIC'])
|
||||
|
||||
if lenv['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross'):
|
||||
if lenv['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
|
||||
libincs += Split(lenv['BF_PTHREADS_LIBPATH'])
|
||||
|
||||
return statlibs, libincs
|
||||
@@ -159,7 +158,7 @@ def setup_syslibs(lenv):
|
||||
]
|
||||
|
||||
if lenv['WITH_BF_PYTHON'] and not lenv['WITH_BF_STATICPYTHON']:
|
||||
if lenv['BF_DEBUG'] and lenv['OURPLATFORM'] in ('win32-vc'):
|
||||
if lenv['BF_DEBUG'] and lenv['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||
syslibs.append(lenv['BF_PYTHON_LIB']+'_d')
|
||||
else:
|
||||
syslibs.append(lenv['BF_PYTHON_LIB'])
|
||||
@@ -187,7 +186,7 @@ def setup_syslibs(lenv):
|
||||
syslibs += Split(lenv['BF_SDL_LIB'])
|
||||
if not lenv['WITH_BF_STATICOPENGL']:
|
||||
syslibs += Split(lenv['BF_OPENGL_LIB'])
|
||||
if lenv['OURPLATFORM'] in ('win32-vc', 'win32-mingw','linuxcross'):
|
||||
if lenv['OURPLATFORM'] in ('win32-vc', 'win32-mingw','linuxcross', 'win64-vc'):
|
||||
syslibs += Split(lenv['BF_PTHREADS_LIB'])
|
||||
|
||||
syslibs += lenv['LLIBS']
|
||||
@@ -391,7 +390,7 @@ class BlenderEnvironment(SConsEnvironment):
|
||||
if not self or not libname or not source:
|
||||
print bc.FAIL+'Cannot continue. Missing argument for BlenderRes '+libname+bc.ENDC
|
||||
self.Exit()
|
||||
if self['OURPLATFORM'] not in ('win32-vc','win32-mingw','linuxcross'):
|
||||
if self['OURPLATFORM'] not in ('win32-vc','win32-mingw','linuxcross', 'win64-vc'):
|
||||
print bc.FAIL+'BlenderRes is for windows only!'+bc.END
|
||||
self.Exit()
|
||||
|
||||
@@ -456,7 +455,7 @@ class BlenderEnvironment(SConsEnvironment):
|
||||
def BlenderProg(self=None, builddir=None, progname=None, sources=None, includes=None, libs=None, libpath=None, binarykind=''):
|
||||
print bc.HEADER+'Configuring program '+bc.ENDC+bc.OKGREEN+progname+bc.ENDC
|
||||
lenv = self.Clone()
|
||||
if lenv['OURPLATFORM'] in ['win32-vc', 'cygwin']:
|
||||
if lenv['OURPLATFORM'] in ('win32-vc', 'cygwin', 'win64-vc'):
|
||||
lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
|
||||
if lenv['BF_DEBUG']:
|
||||
lenv.Prepend(LINKFLAGS = ['/DEBUG','/PDB:'+progname+'.pdb'])
|
||||
@@ -486,7 +485,7 @@ class BlenderEnvironment(SConsEnvironment):
|
||||
lenv.Append(LIBS = lenv['BF_QUICKTIME_LIB'])
|
||||
lenv.Append(LIBPATH = lenv['BF_QUICKTIME_LIBPATH'])
|
||||
prog = lenv.Program(target=builddir+'bin/'+progname, source=sources)
|
||||
if lenv['BF_DEBUG'] and lenv['OURPLATFORM']=='win32-vc' and lenv['BF_BSC']:
|
||||
if lenv['BF_DEBUG'] and lenv['OURPLATFORM'] in ('win32-vc', 'win64-vc') and lenv['BF_BSC']:
|
||||
f = lenv.File(progname + '.bsc', builddir)
|
||||
brs = lenv.Command(f, prog, [bsc])
|
||||
SConsEnvironment.Default(self, brs)
|
||||
|
Reference in New Issue
Block a user