[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12714] trunk/blender: Scons Compiling Hack:

Joshua Leung aligorith at gmail.com
Thu Nov 29 07:31:36 CET 2007


Revision: 12714
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12714
Author:   aligorith
Date:     2007-11-29 07:31:36 +0100 (Thu, 29 Nov 2007)

Log Message:
-----------
Scons Compiling Hack:

Restoring the "evil src splitting hack" for scons+mingw systems. By default, it is not used, but if your system is choking when trying to link src, then add BF_SPLIT_SRC=1 to your user-config.py to use this hack. 

Modified Paths:
--------------
    trunk/blender/source/blender/src/SConscript
    trunk/blender/tools/btools.py

Modified: trunk/blender/source/blender/src/SConscript
===================================================================
--- trunk/blender/source/blender/src/SConscript	2007-11-29 01:41:20 UTC (rev 12713)
+++ trunk/blender/source/blender/src/SConscript	2007-11-29 06:31:36 UTC (rev 12714)
@@ -5,6 +5,20 @@
 
 sources = env.Glob('*.c')
 
+if env['BF_SPLIT_SRC'] == 1:
+	numobj = len(sources) 	 
+	maxobj = 30 	 
+
+	numlibs = numobj / maxobj 	 
+	if (numobj % maxobj): 	 
+		numlibs = numlibs + 1 	 
+	subsources = [] 	 
+	 
+	if (env['OURPLATFORM'] == 'win32-mingw'): 	 
+		for i in range(numlibs - 1): 	 
+			subsources.append(sources[i*maxobj:(i+1)*maxobj]) 	 
+		subsources.append(sources[(numlibs-1)*maxobj:])
+
 incs = ' #/intern/guardedalloc #/intern/memutil'
 incs += ' ../blenlib ../makesdna ../blenkernel'
 incs += ' ../include #/intern/bmfont ../imbuf ../render/extern/include'
@@ -60,5 +74,9 @@
 # TODO buildinfo
 if env['BF_BUILDINFO'] == 1:
     defs.append('NAN_BUILDINFO')
-
-env.BlenderLib ( libname = 'src', sources = sources, includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] )
+	
+if (env['BF_SPLIT_SRC'] == 1) and (env['OURPLATFORM'] == 'win32-mingw'): 	 
+	for i in range(numlibs): 	 
+		env.BlenderLib ( libname = 'src%d' % (i), sources = subsources[i], includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] ) 	 
+else:
+	env.BlenderLib ( libname = 'src', sources = sources, includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] )

Modified: trunk/blender/tools/btools.py
===================================================================
--- trunk/blender/tools/btools.py	2007-11-29 01:41:20 UTC (rev 12713)
+++ trunk/blender/tools/btools.py	2007-11-29 06:31:36 UTC (rev 12714)
@@ -54,7 +54,7 @@
             'BF_PROFILE_FLAGS', 'LCGDIR', 'WITH_BF_VERSE', 
             'BF_VERSE_INCLUDE',
             'VERSE_BUILD_BINARY', 'VERSE_BUILD_DIR', 'VERSE_REGEN_PROTO',
-            'BF_TWEAK_MODE',
+            'BF_TWEAK_MODE', 'BF_SPLIT_SRC',
             'WITHOUT_BF_INSTALL'
             ]
 
@@ -297,6 +297,7 @@
         (BoolOption('BF_BUILDINFO', 'Buildtime in splash if true', 'true')),
 
         (BoolOption('BF_TWEAK_MODE', 'Enable tweak mode if true', 'false')),
+		(BoolOption('BF_SPLIT_SRC', 'Split src lib into several chunks if true', 'false')),
         (BoolOption('WITHOUT_BF_INSTALL', 'dont install if true', 'false')),
 
     ) # end of opts.AddOptions()





More information about the Bf-blender-cvs mailing list