diff options
Diffstat (limited to 'build_files/scons')
-rw-r--r-- | build_files/scons/config/linux2-config.py | 8 | ||||
-rw-r--r-- | build_files/scons/tools/Blender.py | 8 | ||||
-rw-r--r-- | build_files/scons/tools/btools.py | 11 |
3 files changed, 26 insertions, 1 deletions
diff --git a/build_files/scons/config/linux2-config.py b/build_files/scons/config/linux2-config.py index d4e97c78c38..bc2917055fb 100644 --- a/build_files/scons/config/linux2-config.py +++ b/build_files/scons/config/linux2-config.py @@ -178,6 +178,14 @@ BF_EXPAT = '/usr' BF_EXPAT_LIB = 'expat' BF_EXPAT_LIBPATH = '/usr/lib' +WITH_BF_JEMALLOC = False +WITH_BF_STATICJEMALLOC = False +BF_JEMALLOC = '/usr' +BF_JEMALLOC_INC = '${BF_JEMALLOC}/include' +BF_JEMALLOC_LIBPATH = '${BF_JEMALLOC}/lib' +BF_JEMALLOC_LIB = 'jemalloc' +BF_JEMALLOC_LIB_STATIC = '${BF_JEMALLOC_LIBPATH}/libjemalloc.a' + WITH_BF_OPENMP = True #Ray trace optimization diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py index ad4df1a60c1..90c2c35bb98 100644 --- a/build_files/scons/tools/Blender.py +++ b/build_files/scons/tools/Blender.py @@ -203,6 +203,11 @@ def setup_staticlibs(lenv): if lenv['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'): libincs.append('/usr/lib') + if lenv['WITH_BF_JEMALLOC']: + libincs += Split(lenv['BF_JEMALLOC_LIBPATH']) + if lenv['WITH_BF_STATICJEMALLOC']: + statlibs += Split(lenv['BF_JEMALLOC_LIB_STATIC']) + return statlibs, libincs def setup_syslibs(lenv): @@ -263,6 +268,9 @@ def setup_syslibs(lenv): if not lenv['WITH_BF_STATICLIBSAMPLERATE']: syslibs += Split(lenv['BF_LIBSAMPLERATE_LIB']) + if lenv['WITH_BF_JEMALLOC']: + if not lenv['WITH_BF_STATICJEMALLOC']: + syslibs += Split(lenv['BF_JEMALLOC_LIB']) syslibs += lenv['LLIBS'] diff --git a/build_files/scons/tools/btools.py b/build_files/scons/tools/btools.py index fcc782bd824..fda88d7d5a9 100644 --- a/build_files/scons/tools/btools.py +++ b/build_files/scons/tools/btools.py @@ -134,7 +134,8 @@ def validate_arguments(args, bc): 'WITH_BF_RAYOPTIMIZATION', 'BF_RAYOPTIMIZATION_SSE_FLAGS', 'BF_NO_ELBEEM', - 'WITH_BF_CXX_GUARDEDALLOC' + 'WITH_BF_CXX_GUARDEDALLOC', + 'WITH_BF_JEMALLOC', 'WITH_BF_STATICJEMALLOC', 'BF_JEMALLOC', 'BF_JEMALLOC_INC', 'BF_JEMALLOC_LIBPATH', 'BF_JEMALLOC_LIB', 'BF_JEMALLOC_LIB_STATIC' ] # Have options here that scons expects to be lists @@ -429,6 +430,14 @@ def read_opts(env, cfg, args): ('BF_EXPAT_LIB', 'Expat library', ''), ('BF_EXPAT_LIBPATH', 'Expat library path', ''), + (BoolVariable('WITH_BF_JEMALLOC', 'Use jemalloc if true', False)), + (BoolVariable('WITH_BF_STATICJEMALLOC', 'Staticly link to jemalloc', False)), + ('BF_JEMALLOC', 'jemalloc base path', ''), + ('BF_JEMALLOC_INC', 'jemalloc include path', ''), + ('BF_JEMALLOC_LIB', 'jemalloc library', ''), + ('BF_JEMALLOC_LIBPATH', 'jemalloc library path', ''), + ('BF_JEMALLOC_LIB_STATIC', 'jemalloc static library', ''), + (BoolVariable('WITH_BF_PLAYER', 'Build blenderplayer if true', False)), (BoolVariable('WITH_BF_NOBLENDER', 'Do not build blender if true', False)), |