[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37316] trunk/blender: Shuffle some build code around to ensure debug builds on Windows actually run too .

Nathan Letwory nathan at letworyinteractive.com
Wed Jun 8 13:53:08 CEST 2011


Revision: 37316
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37316
Author:   jesterking
Date:     2011-06-08 11:53:07 +0000 (Wed, 08 Jun 2011)
Log Message:
-----------
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

Modified Paths:
--------------
    trunk/blender/SConstruct
    trunk/blender/build_files/scons/config/win64-vc-config.py
    trunk/blender/build_files/scons/tools/Blender.py
    trunk/blender/source/creator/SConscript

Modified: trunk/blender/SConstruct
===================================================================
--- trunk/blender/SConstruct	2011-06-08 10:57:24 UTC (rev 37315)
+++ trunk/blender/SConstruct	2011-06-08 11:53:07 UTC (rev 37316)
@@ -306,10 +306,6 @@
     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 @@
     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
 

Modified: trunk/blender/build_files/scons/config/win64-vc-config.py
===================================================================
--- trunk/blender/build_files/scons/config/win64-vc-config.py	2011-06-08 10:57:24 UTC (rev 37315)
+++ trunk/blender/build_files/scons/config/win64-vc-config.py	2011-06-08 11:53:07 UTC (rev 37316)
@@ -170,7 +170,7 @@
 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']

Modified: trunk/blender/build_files/scons/tools/Blender.py
===================================================================
--- trunk/blender/build_files/scons/tools/Blender.py	2011-06-08 10:57:24 UTC (rev 37315)
+++ trunk/blender/build_files/scons/tools/Blender.py	2011-06-08 11:53:07 UTC (rev 37316)
@@ -258,7 +258,10 @@
         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 @@
             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 @@
 
         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 @@
         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'])

Modified: trunk/blender/source/creator/SConscript
===================================================================
--- trunk/blender/source/creator/SConscript	2011-06-08 10:57:24 UTC (rev 37315)
+++ trunk/blender/source/creator/SConscript	2011-06-08 11:53:07 UTC (rev 37316)
@@ -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()




More information about the Bf-blender-cvs mailing list