From 899f2776db6f41f5bb05342826280f31b66ec79c Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Wed, 8 Jun 2011 11:53:07 +0000 Subject: Shuffle some build code around to ensure debug builds on Windows actually run too. * creator/SConscript is now empty, code is moved to an emitter function in Blender.py * make sure COLLADA debug libs are used when BF_DEBUG=True --- SConstruct | 9 ++--- build_files/scons/config/win64-vc-config.py | 2 +- build_files/scons/tools/Blender.py | 59 +++++++++++++++++++++++++---- source/creator/SConscript | 47 +---------------------- 4 files changed, 56 insertions(+), 61 deletions(-) diff --git a/SConstruct b/SConstruct index e928970f6b8..2f63ddf0501 100644 --- a/SConstruct +++ b/SConstruct @@ -306,10 +306,6 @@ if env['BF_NO_ELBEEM'] == 1: env['CXXFLAGS'].append('-DDISABLE_ELBEEM') env['CCFLAGS'].append('-DDISABLE_ELBEEM') -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') - # lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir B.root_build_dir = env['BF_BUILDDIR'] B.doc_build_dir = os.path.join(env['BF_INSTALLDIR'], 'doc') @@ -409,17 +405,18 @@ if B.arguments.get('BF_PRIORITYLIST', '0')=='1': B.propose_priorities() dobj = B.buildinfo(env, "dynamic") + B.resources +creob = B.creator(env) 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", mainlist + thestatlibs + dobj, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender') + env.BlenderProg(B.root_build_dir, "blender", creob + mainlist + thestatlibs + dobj, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender') if env['WITH_BF_PLAYER']: playerlist = B.create_blender_liblist(env, 'player') playerlist += B.create_blender_liblist(env, 'player2') playerlist += B.create_blender_liblist(env, 'intern') playerlist += B.create_blender_liblist(env, 'extern') - env.BlenderProg(B.root_build_dir, "blenderplayer", playerlist + thestatlibs + dobj, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer') + env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist + thestatlibs, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer') ##### Now define some targets diff --git a/build_files/scons/config/win64-vc-config.py b/build_files/scons/config/win64-vc-config.py index 2c990941764..3332a560ed2 100644 --- a/build_files/scons/config/win64-vc-config.py +++ b/build_files/scons/config/win64-vc-config.py @@ -170,7 +170,7 @@ CCFLAGS = ['/nologo', '/Ob1', '/J', '/W0', '/Gd', '/we4013', '/wd4018', '/wd4244 CXXFLAGS = ['/EHsc'] BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast'] -BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr'] +BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr', '/Od'] CPPFLAGS = ['-DWIN32', '-D_CONSOLE', '-D_LIB', '-DFTGL_LIBRARY_STATIC', '-D_CRT_SECURE_NO_DEPRECATE'] REL_CFLAGS = ['-O2', '-DNDEBUG'] diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py index 8dbed82ed84..50f43a03b8b 100644 --- a/build_files/scons/tools/Blender.py +++ b/build_files/scons/tools/Blender.py @@ -258,7 +258,10 @@ def setup_syslibs(lenv): syslibs += Split(lenv['BF_PTHREADS_LIB']) if lenv['WITH_BF_COLLADA']: syslibs.append(lenv['BF_PCRE_LIB']) - syslibs += Split(lenv['BF_OPENCOLLADA_LIB']) + if lenv['BF_DEBUG']: + syslibs += [colladalib+'_d' for colladalib in Split(lenv['BF_OPENCOLLADA_LIB'])] + else: + syslibs += Split(lenv['BF_OPENCOLLADA_LIB']) syslibs.append(lenv['BF_EXPAT_LIB']) if not lenv['WITH_BF_STATICLIBSAMPLERATE']: @@ -287,6 +290,50 @@ def propose_priorities(): print "\t\t",new_priority, v new_priority += 5 +# emits the necessary file objects for creator.c, to be used in creating +# the final blender executable +def creator(env): + sources = ['creator.c']# + Blender.buildinfo(env, "dynamic") + Blender.resources + + incs = ['#/intern/guardedalloc', '#/source/blender/blenlib', '#/source/blender/blenkernel', '#/source/blender/editors/include', '#/source/blender/blenloader', '#/source/blender/imbuf', '#/source/blender/renderconverter', '#/source/blender/render/extern/include', '#/source/blender/windowmanager', '#/source/blender/makesdna', '#/source/blender/makesrna', '#/source/gameengine/BlenderRoutines', '#/extern/glew/include', '#/source/blender/gpu', env['BF_OPENGL_INC']] + + defs = [] + if env['WITH_BF_QUICKTIME']: + incs.append(env['BF_QUICKTIME_INC']) + defs.append('WITH_QUICKTIME') + + if env['WITH_BF_BINRELOC']: + incs.append('#/extern/binreloc/include') + defs.append('WITH_BINRELOC') + + if env['WITH_BF_OPENEXR']: + defs.append('WITH_OPENEXR') + + if env['WITH_BF_TIFF']: + defs.append('WITH_TIFF') + + if not env['WITH_BF_SDL']: + defs.append('DISABLE_SDL') + + if env['WITH_BF_PYTHON']: + incs.append('#/source/blender/python') + defs.append('WITH_PYTHON') + if env['BF_DEBUG']: + defs.append('_DEBUG') + + if env['BF_BUILDINFO']: + defs.append('BUILD_DATE') + defs.append('NAN_BUILDINFO') + + if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): + incs.append(env['BF_PTHREADS_INC']) + + env.Append(CPPDEFINES=defs) + env.Append(CPPPATH=incs) + obj = [env.Object(root_build_dir+'source/creator/creator/creator', ['#source/creator/creator.c'])] + + return obj + ## TODO: see if this can be made in an emitter def buildinfo(lenv, build_type): """ @@ -324,7 +371,7 @@ def buildinfo(lenv, build_type): lenv.Append (CPPPATH = [root_build_dir+'source/blender/blenkernel']) - obj = [lenv.Object (root_build_dir+'source/creator/%s_buildinfo'%build_type, [root_build_dir+'source/creator/buildinfo.c'])] + obj = [lenv.Object (root_build_dir+'source/creator/%s_buildinfo'%build_type, ['#source/creator/buildinfo.c'])] return obj @@ -714,23 +761,19 @@ class BlenderEnvironment(SConsEnvironment): global vcp print bc.HEADER+'Configuring program '+bc.ENDC+bc.OKGREEN+progname+bc.ENDC lenv = self.Clone() + lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS']) if lenv['OURPLATFORM'] in ('win32-vc', 'cygwin', 'win64-vc'): - lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS']) - lenv.Append(LINKFLAGS = ['/FORCE:MULTIPLE']) if lenv['BF_DEBUG']: - lenv.Prepend(LINKFLAGS = ['/DEBUG','/PDB:'+progname+'.pdb']) + lenv.Prepend(LINKFLAGS = ['/DEBUG','/PDB:'+progname+'.pdb','/NODEFAULTLIB:libcmt']) if lenv['OURPLATFORM']=='linux2': - lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS']) if lenv['WITH_BF_PYTHON']: lenv.Append(LINKFLAGS = lenv['BF_PYTHON_LINKFLAGS']) if lenv['OURPLATFORM']=='sunos5': - lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS']) if lenv['WITH_BF_PYTHON']: lenv.Append(LINKFLAGS = lenv['BF_PYTHON_LINKFLAGS']) if lenv['CXX'].endswith('CC'): lenv.Replace(LINK = '$CXX') if lenv['OURPLATFORM']=='darwin': - lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS']) if lenv['WITH_BF_PYTHON']: lenv.Append(LINKFLAGS = lenv['BF_PYTHON_LINKFLAGS']) lenv.Append(LINKFLAGS = lenv['BF_OPENGL_LINKFLAGS']) diff --git a/source/creator/SConscript b/source/creator/SConscript index 79e03c8dddc..80428ba7bb6 100644 --- a/source/creator/SConscript +++ b/source/creator/SConscript @@ -1,48 +1,3 @@ #!/usr/bin/python -Import ('env') -import os -sources = 'creator.c' - -incs = '#/intern/guardedalloc ../blender/blenlib ../blender/blenkernel' -incs += ' ../blender/editors/include ../blender/blenloader ../blender/imbuf' -incs += ' ../blender/renderconverter ../blender/render/extern/include ../blender/windowmanager' -incs += ' ../blender/makesdna ../blender/makesrna' -incs += ' ../gameengine/BlenderRoutines #/extern/glew/include ../blender/gpu' -incs += ' ' + env['BF_OPENGL_INC'] - -defs = [] -if env['WITH_BF_QUICKTIME']: - incs += ' ' + env['BF_QUICKTIME_INC'] - defs.append('WITH_QUICKTIME') - -if env['WITH_BF_BINRELOC']: - incs += ' ../../extern/binreloc/include' - defs.append('WITH_BINRELOC') - -if env['WITH_BF_OPENEXR']: - defs.append('WITH_OPENEXR') - -if env['WITH_BF_TIFF']: - defs.append('WITH_TIFF') - -if not env['WITH_BF_SDL']: - defs.append('DISABLE_SDL') - -if env['WITH_BF_PYTHON']: - incs += ' ../blender/python' - defs.append('WITH_PYTHON') - if env['BF_DEBUG']: - defs.append('_DEBUG') - -if env['BF_BUILDINFO']: - defs.append('BUILD_DATE') - defs.append('NAN_BUILDINFO') - -if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): - incs += ' ' + env['BF_PTHREADS_INC'] - -if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): - incs += ' ' + env['BF_PTHREADS_INC'] - -env.BlenderLib ( libname = 'bf_creator', sources = Split(sources), includes = Split(incs), defines = defs, libtype='core', priority = 0 ) +# dummy, code has been moved to Blender.creator() -- cgit v1.2.3