3 # ***** BEGIN GPL LICENSE BLOCK *****
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software Foundation,
17 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 # The Original Code is Copyright (C) 2006, Blender Foundation
20 # All rights reserved.
22 # The Original Code is: all of this file.
24 # Contributor(s): Nathan Letwory.
26 # ***** END GPL LICENSE BLOCK *****
28 # Main entry-point for the SCons building system
29 # Set up some custom actions and target/argument handling
30 # Then read all SConscripts and build
32 # TODO: fix /FORCE:MULTIPLE on windows to get proper debug builds.
33 # TODO: directory copy functions are far too complicated, see:
34 # http://wiki.blender.org/index.php/User:Ideasman42/SConsNotSimpleInstallingFiles
36 import platform as pltfrm
38 # Need a better way to do this. Automagical maybe is not the best thing, maybe it is.
39 if pltfrm.architecture()[0] == '64bit':
51 from tempfile import mkdtemp
54 toolpath=os.path.join(".", "build_files", "scons", "tools")
56 # needed for importing tools
57 sys.path.append(toolpath)
63 EnsureSConsVersion(1,0,0)
65 # Before we do anything, let's check if we have a sane os.environ
66 if not btools.check_environ():
69 BlenderEnvironment = Blender.BlenderEnvironment
72 VERSION = btools.VERSION # This is used in creating the local config directories
75 platform = sys.platform
79 ##### BEGIN SETUP #####
81 B.possible_types = ['core', 'player', 'player2', 'intern', 'extern']
83 B.binarykind = ['blender' , 'blenderplayer']
84 ##################################
85 # target and argument validation #
86 ##################################
87 # XX cheating for BF_FANCY, we check for BF_FANCY before args are validated
88 use_color = ARGUMENTS.get('BF_FANCY', '1')
92 if not use_color=='1':
95 #on defaut white Os X terminal, some colors are totally unlegible
96 if platform=='darwin':
97 B.bc.OKGREEN = '\033[34m'
98 B.bc.WARNING = '\033[36m'
101 print B.bc.HEADER+'Command-line arguments'+B.bc.ENDC
102 B.arguments = btools.validate_arguments(ARGUMENTS, B.bc)
103 btools.print_arguments(B.arguments, B.bc)
106 print B.bc.HEADER+'Command-line targets'+B.bc.ENDC
107 B.targets = btools.validate_targets(COMMAND_LINE_TARGETS, B.bc)
108 btools.print_targets(B.targets, B.bc)
110 ##########################
111 # setting up environment #
112 ##########################
114 # handling cmd line arguments & config file
117 tempbitness = int(B.arguments.get('BF_BITNESS', bitness)) # default to bitness found as per starting python
118 if tempbitness in (32, 64): # only set if 32 or 64 has been given
119 bitness = int(tempbitness)
121 # first check cmdline for toolset and we create env to work on
122 quickie = B.arguments.get('BF_QUICK', None)
123 quickdebug = B.arguments.get('BF_QUICKDEBUG', None)
126 B.quickdebug=string.split(quickdebug, ',')
131 B.quickie=string.split(quickie,',')
135 toolset = B.arguments.get('BF_TOOLSET', None)
137 print "Using " + toolset
138 if toolset=='mstoolkit':
139 env = BlenderEnvironment(ENV = os.environ)
140 env.Tool('mstoolkit', [toolpath])
142 env = BlenderEnvironment(tools=[toolset], ENV = os.environ)
143 # xxx commented out, as was supressing warnings under mingw..
145 # btools.SetupSpawn(env)
147 if bitness==64 and platform=='win32':
148 env = BlenderEnvironment(ENV = os.environ, MSVS_ARCH='amd64')
150 env = BlenderEnvironment(ENV = os.environ)
153 print "Could not create a build environment"
156 cc = B.arguments.get('CC', None)
157 cxx = B.arguments.get('CXX', None)
163 if sys.platform=='win32':
164 if env['CC'] in ['cl', 'cl.exe']:
165 platform = 'win64-vc' if bitness == 64 else 'win32-vc'
166 elif env['CC'] in ['gcc']:
167 platform = 'win32-mingw'
169 env.SConscriptChdir(0)
171 # Remove major kernel version from linux platform.
172 # After Linus switched kernel to new version model this major version
173 # shouldn't take much sense for building rules.
175 if re.match('linux[0-9]+', platform):
178 crossbuild = B.arguments.get('BF_CROSS', None)
179 if crossbuild and platform not in ('win32-vc', 'win64-vc'):
180 platform = 'linuxcross'
182 env['OURPLATFORM'] = platform
184 configfile = os.path.join("build_files", "scons", "config", platform + "-config.py")
186 if os.path.exists(configfile):
187 print B.bc.OKGREEN + "Using config file: " + B.bc.ENDC + configfile
189 print B.bc.FAIL + configfile + " doesn't exist" + B.bc.ENDC
191 if crossbuild and env['PLATFORM'] != 'win32':
192 print B.bc.HEADER+"Preparing for crossbuild"+B.bc.ENDC
193 env.Tool('crossmingw', [toolpath])
194 # todo: determine proper libs/includes etc.
195 # Needed for gui programs, console programs should do without it
197 # Now we don't need this option to have console window
198 # env.Append(LINKFLAGS=['-mwindows'])
200 userconfig = B.arguments.get('BF_CONFIG', 'user-config.py')
201 # first read platform config. B.arguments will override
202 optfiles = [configfile]
203 if os.path.exists(userconfig):
204 print B.bc.OKGREEN + "Using user-config file: " + B.bc.ENDC + userconfig
205 optfiles += [userconfig]
207 print B.bc.WARNING + userconfig + " not found, no user overrides" + B.bc.ENDC
209 opts = btools.read_opts(env, optfiles, B.arguments)
212 if sys.platform=='win32':
214 env.Append(CPPFLAGS=['-DWIN64']) # -DWIN32 needed too, as it's used all over to target Windows generally
216 if not env['BF_FANCY']:
220 # remove install dir so old and new files are not mixed.
221 # NOTE: only do the scripts directory for now, otherwise is too disruptive for developers
222 # TODO: perhaps we need an option (off by default) to not do this altogether...
223 if not env['WITHOUT_BF_INSTALL'] and not env['WITHOUT_BF_OVERWRITE_INSTALL']:
224 scriptsDir = os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts')
225 if os.path.isdir(scriptsDir):
226 print B.bc.OKGREEN + "Clearing installation directory%s: %s" % (B.bc.ENDC, os.path.abspath(scriptsDir))
227 shutil.rmtree(scriptsDir)
230 SetOption('num_jobs', int(env['BF_NUMJOBS']))
231 print B.bc.OKGREEN + "Build with parallel jobs%s: %s" % (B.bc.ENDC, GetOption('num_jobs'))
232 print B.bc.OKGREEN + "Build with debug symbols%s: %s" % (B.bc.ENDC, env['BF_DEBUG'])
234 if 'blenderlite' in B.targets:
236 target_env_defs['WITH_BF_GAMEENGINE'] = False
237 target_env_defs['WITH_BF_OPENAL'] = False
238 target_env_defs['WITH_BF_OPENEXR'] = False
239 target_env_defs['WITH_BF_OPENMP'] = False
240 target_env_defs['WITH_BF_ICONV'] = False
241 target_env_defs['WITH_BF_INTERNATIONAL'] = False
242 target_env_defs['WITH_BF_OPENJPEG'] = False
243 target_env_defs['WITH_BF_FFMPEG'] = False
244 target_env_defs['WITH_BF_QUICKTIME'] = False
245 target_env_defs['WITH_BF_REDCODE'] = False
246 target_env_defs['WITH_BF_DDS'] = False
247 target_env_defs['WITH_BF_CINEON'] = False
248 target_env_defs['WITH_BF_HDR'] = False
249 target_env_defs['WITH_BF_ZLIB'] = False
250 target_env_defs['WITH_BF_SDL'] = False
251 target_env_defs['WITH_BF_JPEG'] = False
252 target_env_defs['WITH_BF_PNG'] = False
253 target_env_defs['WITH_BF_BULLET'] = False
254 target_env_defs['WITH_BF_BINRELOC'] = False
255 target_env_defs['BF_BUILDINFO'] = False
256 target_env_defs['WITH_BF_FLUID'] = False
257 target_env_defs['WITH_BF_DECIMATE'] = False
258 target_env_defs['WITH_BF_BOOLEAN'] = False
259 target_env_defs['WITH_BF_PYTHON'] = False
260 target_env_defs['WITH_BF_3DMOUSE'] = False
262 # Merge blenderlite, let command line to override
263 for k,v in target_env_defs.iteritems():
264 if k not in B.arguments:
267 # Extended OSX_SDK and 3D_CONNEXION_CLIENT_LIBRARY detection for OSX
268 if env['OURPLATFORM']=='darwin':
269 print B.bc.OKGREEN + "Detected Xcode version: -- " + B.bc.ENDC + env['XCODE_CUR_VER'][:9] + " --"
270 print "Available " + env['MACOSX_SDK_CHECK']
271 if not 'Mac OS X 10.5' in env['MACOSX_SDK_CHECK']:
272 print B.bc.OKGREEN + "MacOSX10.5.sdk not available:" + B.bc.ENDC + " using MacOSX10.6.sdk"
274 print B.bc.OKGREEN + "Found recommended sdk :" + B.bc.ENDC + " using MacOSX10.5.sdk"
276 # for now, Mac builders must download and install the 3DxWare 10 Beta 4 driver framework from 3Dconnexion
277 # necessary header file lives here when installed:
278 # /Library/Frameworks/3DconnexionClient.framework/Versions/Current/Headers/ConnexionClientAPI.h
279 if env['WITH_BF_3DMOUSE'] == 1:
280 if not os.path.exists('/Library/Frameworks/3DconnexionClient.framework'):
281 print "3D_CONNEXION_CLIENT_LIBRARY not found, disabling WITH_BF_3DMOUSE" # avoid build errors !
282 env['WITH_BF_3DMOUSE'] = 0
284 env.Append(LINKFLAGS=['-Xlinker','-weak_framework','-Xlinker','3DconnexionClient'])
286 if env['WITH_BF_OPENMP'] == 1:
287 if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
288 env['CCFLAGS'].append('/openmp')
290 if env['CC'].endswith('icc'): # to be able to handle CC=/opt/bla/icc case
291 env.Append(LINKFLAGS=['-openmp', '-static-intel'])
292 env['CCFLAGS'].append('-openmp')
294 env.Append(CCFLAGS=['-fopenmp'])
296 if env['WITH_GHOST_COCOA'] == True:
297 env.Append(CPPFLAGS=['-DGHOST_COCOA'])
299 if env['USE_QTKIT'] == True:
300 env.Append(CPPFLAGS=['-DUSE_QTKIT'])
302 #check for additional debug libnames
304 if env.has_key('BF_DEBUG_LIBS'):
305 B.quickdebug += env['BF_DEBUG_LIBS']
307 printdebug = B.arguments.get('BF_LISTDEBUG', 0)
309 if len(B.quickdebug) > 0 and printdebug != 0:
310 print B.bc.OKGREEN + "Buildings these libs with debug symbols:" + B.bc.ENDC
311 for l in B.quickdebug:
314 # remove stdc++ from LLIBS if we are building a statc linked CXXFLAGS
315 if env['WITH_BF_STATICCXX']:
316 if 'stdc++' in env['LLIBS']:
317 env['LLIBS'].remove('stdc++')
319 print '\tcould not remove stdc++ library from LLIBS, WITH_BF_STATICCXX may not work for your platform'
321 # check target for blenderplayer. Set WITH_BF_PLAYER if found on cmdline
322 if 'blenderplayer' in B.targets:
323 env['WITH_BF_PLAYER'] = True
325 if 'blendernogame' in B.targets:
326 env['WITH_BF_GAMEENGINE'] = False
328 # build without elbeem (fluidsim)?
329 if env['WITH_BF_FLUID'] == 1:
330 env['CPPFLAGS'].append('-DWITH_MOD_FLUID')
333 if btools.ENDIAN == "big":
334 env['CPPFLAGS'].append('-D__BIG_ENDIAN__')
336 env['CPPFLAGS'].append('-D__LITTLE_ENDIAN__')
338 # TODO, make optional
339 env['CPPFLAGS'].append('-DWITH_AUDASPACE')
341 # lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
342 B.root_build_dir = env['BF_BUILDDIR']
343 B.doc_build_dir = os.path.join(env['BF_INSTALLDIR'], 'doc')
344 if not B.root_build_dir[-1]==os.sep:
345 B.root_build_dir += os.sep
346 if not B.doc_build_dir[-1]==os.sep:
347 B.doc_build_dir += os.sep
349 # We do a shortcut for clean when no quicklist is given: just delete
350 # builddir without reading in SConscripts
352 if 'clean' in B.targets:
355 if not quickie and do_clean:
356 if os.path.exists(B.doc_build_dir):
357 print B.bc.HEADER+'Cleaning doc dir...'+B.bc.ENDC
358 dirs = os.listdir(B.doc_build_dir)
360 if os.path.isdir(B.doc_build_dir + entry) == 1:
361 print "clean dir %s"%(B.doc_build_dir+entry)
362 shutil.rmtree(B.doc_build_dir+entry)
364 print "remove file %s"%(B.doc_build_dir+entry)
365 os.remove(B.root_build_dir+entry)
366 if os.path.exists(B.root_build_dir):
367 print B.bc.HEADER+'Cleaning build dir...'+B.bc.ENDC
368 dirs = os.listdir(B.root_build_dir)
370 if os.path.isdir(B.root_build_dir + entry) == 1:
371 print "clean dir %s"%(B.root_build_dir+entry)
372 shutil.rmtree(B.root_build_dir+entry)
374 print "remove file %s"%(B.root_build_dir+entry)
375 os.remove(B.root_build_dir+entry)
376 for confile in ['extern/ffmpeg/config.mak', 'extern/x264/config.mak',
377 'extern/xvidcore/build/generic/platform.inc', 'extern/ffmpeg/include']:
378 if os.path.exists(confile):
379 print "clean file %s"%confile
380 if os.path.isdir(confile):
381 for root, dirs, files in os.walk(confile):
383 os.remove(os.path.join(root, name))
386 print B.bc.OKGREEN+'...done'+B.bc.ENDC
388 print B.bc.HEADER+'Already Clean, nothing to do.'+B.bc.ENDC
392 # ensure python header is found since detection can fail, this could happen
393 # with _any_ library but since we used a fixed python version this tends to
394 # be most problematic.
395 if env['WITH_BF_PYTHON']:
396 py_h = os.path.join(Dir(env.subst('${BF_PYTHON_INC}')).abspath, "Python.h")
398 if not os.path.exists(py_h):
399 print("\nMissing: \"" + env.subst('${BF_PYTHON_INC}') + os.sep + "Python.h\",\n"
400 " Set 'BF_PYTHON_INC' to point "
401 "to a valid python include path.\n Containing "
402 "Python.h for python version \"" + env.subst('${BF_PYTHON_VERSION}') + "\"")
408 if not os.path.isdir ( B.root_build_dir):
409 os.makedirs ( B.root_build_dir )
410 os.makedirs ( B.root_build_dir + 'source' )
411 os.makedirs ( B.root_build_dir + 'intern' )
412 os.makedirs ( B.root_build_dir + 'extern' )
413 os.makedirs ( B.root_build_dir + 'lib' )
414 os.makedirs ( B.root_build_dir + 'bin' )
415 # # Docs not working with epy anymore
416 # if not os.path.isdir(B.doc_build_dir) and env['WITH_BF_DOCS']:
417 # os.makedirs ( B.doc_build_dir )
419 Help(opts.GenerateHelpText(env))
421 # default is new quieter output, but if you need to see the
422 # commands, do 'scons BF_QUIET=0'
423 bf_quietoutput = B.arguments.get('BF_QUIET', '1')
425 B.set_quiet_output(env)
430 print B.bc.HEADER+'Building in: ' + B.bc.ENDC + os.path.abspath(B.root_build_dir)
431 env.SConsignFile(B.root_build_dir+'scons-signatures')
434 ##### END SETUP ##########
438 BuildDir(B.root_build_dir+'/intern', 'intern', duplicate=0)
439 SConscript(B.root_build_dir+'/intern/SConscript')
440 BuildDir(B.root_build_dir+'/extern', 'extern', duplicate=0)
441 SConscript(B.root_build_dir+'/extern/SConscript')
442 BuildDir(B.root_build_dir+'/source', 'source', duplicate=0)
443 SConscript(B.root_build_dir+'/source/SConscript')
445 # now that we have read all SConscripts, we know what
446 # libraries will be built. Create list of
447 # libraries to give as objects to linking phase
449 for tp in B.possible_types:
450 if (not tp == 'player') and (not tp == 'player2'):
451 mainlist += B.create_blender_liblist(env, tp)
453 if B.arguments.get('BF_PRIORITYLIST', '0')=='1':
454 B.propose_priorities()
456 dobj = B.buildinfo(env, "dynamic") + B.resources
457 creob = B.creator(env)
458 thestatlibs, thelibincs = B.setup_staticlibs(env)
459 thesyslibs = B.setup_syslibs(env)
461 if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']:
462 env.BlenderProg(B.root_build_dir, "blender", creob + mainlist + thestatlibs + dobj, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
463 if env['WITH_BF_PLAYER']:
464 playerlist = B.create_blender_liblist(env, 'player')
465 playerlist += B.create_blender_liblist(env, 'player2')
466 playerlist += B.create_blender_liblist(env, 'intern')
467 playerlist += B.create_blender_liblist(env, 'extern')
468 env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist + thestatlibs, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer')
470 ##### Now define some targets
473 #------------ INSTALL
477 if env['OURPLATFORM']=='darwin':
478 for prg in B.program_list:
479 bundle = '%s.app' % prg[0]
480 bundledir = os.path.dirname(bundle)
481 for dp, dn, df in os.walk(bundle):
486 dir=env['BF_INSTALLDIR']+dp[len(bundledir):]
487 source=[dp+os.sep+f for f in df]
488 blenderinstall.append(env.Install(dir=dir,source=source))
490 blenderinstall = env.Install(dir=env['BF_INSTALLDIR'], source=B.program_list)
492 #-- local path = config files in install dir: installdir\VERSION
493 #- dont do config and scripts for darwin, it is already in the bundle
496 datafilestargetlist = []
500 if env['OURPLATFORM']!='darwin':
501 dotblenderinstall = []
502 for targetdir,srcfile in zip(dottargetlist, dotblendlist):
503 td, tf = os.path.split(targetdir)
504 dotblenderinstall.append(env.Install(dir=td, source=srcfile))
505 for targetdir,srcfile in zip(datafilestargetlist, datafileslist):
506 td, tf = os.path.split(targetdir)
507 dotblenderinstall.append(env.Install(dir=td, source=srcfile))
509 if env['WITH_BF_PYTHON']:
510 #-- local/VERSION/scripts
511 scriptpaths=['release/scripts']
512 for scriptpath in scriptpaths:
513 for dp, dn, df in os.walk(scriptpath):
518 if '__pycache__' in dn: # py3.2 cache dir
519 dn.remove('__pycache__')
521 dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
522 dir += os.sep + os.path.basename(scriptpath) + dp[len(scriptpath):]
524 source=[os.path.join(dp, f) for f in df if not f.endswith(".pyc")]
525 # To ensure empty dirs are created too
527 env.Execute(Mkdir(dir))
528 scriptinstall.append(env.Install(dir=dir,source=source))
530 if env['WITH_BF_INTERNATIONAL']:
531 internationalpaths=['release' + os.sep + 'datafiles']
533 def check_path(path, member):
534 return (member in path.split(os.sep))
536 for intpath in internationalpaths:
537 for dp, dn, df in os.walk(intpath):
543 # we only care about release/datafiles/fonts, release/datafiles/locales
544 if check_path(dp, "fonts") or check_path(dp, "locale"):
549 dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
550 dir += os.sep + os.path.basename(intpath) + dp[len(intpath):]
552 source=[os.path.join(dp, f) for f in df if not f.endswith(".pyc")]
553 # To ensure empty dirs are created too
555 env.Execute(Mkdir(dir))
556 scriptinstall.append(env.Install(dir=dir,source=source))
559 if env['OURPLATFORM']=='linux':
563 for tp, tn, tf in os.walk('release/freedesktop/icons'):
569 iconlist.append(os.path.join(tp, f))
570 icontargetlist.append( os.path.join(*([env['BF_INSTALLDIR']] + tp.split(os.sep)[2:] + [f])) )
573 for targetdir,srcfile in zip(icontargetlist, iconlist):
574 td, tf = os.path.split(targetdir)
575 iconinstall.append(env.Install(dir=td, source=srcfile))
577 # dlls for linuxcross
578 # TODO - add more libs, for now this lets blenderlite run
579 if env['OURPLATFORM']=='linuxcross':
580 dir=env['BF_INSTALLDIR']
583 if env['WITH_BF_OPENMP']:
584 source += ['../lib/windows/pthreads/lib/pthreadGC2.dll']
586 scriptinstall.append(env.Install(dir=dir, source=source))
591 for tp, tn, tf in os.walk('release/plugins'):
596 df = tp[8:] # remove 'release/'
598 pluglist.append(os.path.join(tp, f))
599 plugtargetlist.append( os.path.join(env['BF_INSTALLDIR'], VERSION, df, f) )
602 # header files for plugins
603 pluglist.append('source/blender/blenpluginapi/documentation.h')
604 plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'documentation.h'))
605 pluglist.append('source/blender/blenpluginapi/externdef.h')
606 plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'externdef.h'))
607 pluglist.append('source/blender/blenpluginapi/floatpatch.h')
608 plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'floatpatch.h'))
609 pluglist.append('source/blender/blenpluginapi/iff.h')
610 plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'iff.h'))
611 pluglist.append('source/blender/blenpluginapi/plugin.h')
612 plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'plugin.h'))
613 pluglist.append('source/blender/blenpluginapi/util.h')
614 plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'util.h'))
615 pluglist.append('source/blender/blenpluginapi/plugin.DEF')
616 plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'plugin.def'))
619 # plugins in blender 2.5 don't work at the moment.
620 #for targetdir,srcfile in zip(plugtargetlist, pluglist):
621 # td, tf = os.path.split(targetdir)
622 # plugininstall.append(env.Install(dir=td, source=srcfile))
626 for tp, tn, tf in os.walk('release/text'):
632 textlist.append(tp+os.sep+f)
634 textinstall = env.Install(dir=env['BF_INSTALLDIR'], source=textlist)
636 if env['OURPLATFORM']=='darwin':
637 allinstall = [blenderinstall, plugininstall, textinstall]
638 elif env['OURPLATFORM']=='linux':
639 allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall, iconinstall]
641 allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall]
643 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
646 if not env['OURPLATFORM'] in ('win32-mingw', 'linuxcross'):
647 # For MinGW and linuxcross static linking will be used
648 dllsources += ['${LCGDIR}/gettext/lib/gnu_gettext.dll']
650 #currently win64-vc doesn't appear to have libpng.dll
651 if env['OURPLATFORM'] != 'win64-vc':
652 dllsources += ['${BF_PNG_LIBPATH}/libpng.dll']
654 dllsources += ['${BF_ZLIB_LIBPATH}/zlib.dll']
655 # Used when linking to libtiff was dynamic
656 # keep it here until compilation on all platform would be ok
657 # dllsources += ['${BF_TIFF_LIBPATH}/${BF_TIFF_LIB}.dll']
659 if env['OURPLATFORM'] != 'linuxcross':
660 # pthreads library is already added
661 dllsources += ['${BF_PTHREADS_LIBPATH}/${BF_PTHREADS_LIB}.dll']
663 if env['WITH_BF_SDL']:
664 if env['OURPLATFORM'] == 'win64-vc':
665 pass # we link statically already to SDL on win64
667 dllsources.append('${BF_SDL_LIBPATH}/SDL.dll')
669 if env['WITH_BF_PYTHON']:
671 dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}_d.dll')
673 dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}.dll')
675 if env['WITH_BF_ICONV']:
676 if env['OURPLATFORM'] == 'win64-vc':
677 pass # we link statically to iconv on win64
678 elif not env['OURPLATFORM'] in ('win32-mingw', 'linuxcross'):
679 #gettext for MinGW and cross-compilation is compiled staticly
680 dllsources += ['${BF_ICONV_LIBPATH}/iconv.dll']
682 if env['WITH_BF_OPENAL']:
683 dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll')
684 dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll')
686 if env['WITH_BF_SNDFILE']:
687 dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll')
689 if env['WITH_BF_FFMPEG']:
690 dllsources += env['BF_FFMPEG_DLL'].split()
692 # Since the thumb handler is loaded by Explorer, architecture is
693 # strict: the x86 build fails on x64 Windows. We need to ship
694 # both builds in x86 packages.
696 dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb.dll')
697 dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb64.dll')
699 dllsources.append('#source/icons/blender.exe.manifest')
701 windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
702 allinstall += windlls
704 installtarget = env.Alias('install', allinstall)
705 bininstalltarget = env.Alias('install-bin', blenderinstall)
707 nsisaction = env.Action(btools.NSIS_Installer, btools.NSIS_print)
708 nsiscmd = env.Command('nsisinstaller', None, nsisaction)
709 nsisalias = env.Alias('nsis', nsiscmd)
711 if 'blender' in B.targets:
712 blenderexe= env.Alias('blender', B.program_list)
713 Depends(blenderexe,installtarget)
715 if env['WITH_BF_PLAYER']:
716 blenderplayer = env.Alias('blenderplayer', B.program_list)
717 Depends(blenderplayer,installtarget)
719 if not env['WITH_BF_GAMEENGINE']:
720 blendernogame = env.Alias('blendernogame', B.program_list)
721 Depends(blendernogame,installtarget)
723 if 'blenderlite' in B.targets:
724 blenderlite = env.Alias('blenderlite', B.program_list)
725 Depends(blenderlite,installtarget)
727 Depends(nsiscmd, allinstall)
729 buildslave_action = env.Action(btools.buildslave, btools.buildslave_print)
730 buildslave_cmd = env.Command('buildslave_exec', None, buildslave_action)
731 buildslave_alias = env.Alias('buildslave', buildslave_cmd)
733 Depends(buildslave_cmd, allinstall)
735 Default(B.program_list)
737 if not env['WITHOUT_BF_INSTALL']:
738 Default(installtarget)