diff options
-rw-r--r-- | source/blender/src/SConscript | 22 | ||||
-rwxr-xr-x | tools/btools.py | 3 |
2 files changed, 22 insertions, 3 deletions
diff --git a/source/blender/src/SConscript b/source/blender/src/SConscript index ba3e03ea1eb..f466798c40c 100644 --- a/source/blender/src/SConscript +++ b/source/blender/src/SConscript @@ -5,6 +5,20 @@ Import ('env') 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 @@ if env['WITH_BF_VERSE']: # 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] ) diff --git a/tools/btools.py b/tools/btools.py index eb8f844df4d..455335ab895 100755 --- a/tools/btools.py +++ b/tools/btools.py @@ -54,7 +54,7 @@ def validate_arguments(args, bc): '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 @@ def read_opts(cfg, args): (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() |