diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-11-15 17:11:12 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-11-15 17:11:12 +0400 |
commit | 9eccf40daa7edccc6ca9613611c12270cddbd773 (patch) | |
tree | 9bf3eb7fa85d6cfe017b884c515d6e961a34c9ce /build_files/scons/tools | |
parent | abeeea6a96dcb69451a394546f75501a61382b9d (diff) |
OSL Scons rules
Initial support of OSL builds using SCons build system. Only tested on Linux now.
No changes to configuration files themselves -- for now check how it's configured
for linux buildbot (it was already horror to make all this changes and verify them,
changes to linux-config.py could easily be done later).
Currently WITH_BF_STATICOSL and WITH_BF_STATICLLVM are more like rudiments because
linking against oslexec requires special trick with --whole-archive. We woul either
need to find a way dealing with this oslexec less hackish or drop STATICOSL and
STATICLLVM flags. Will keep dropping this flags for until we have "final" build
rules for OSL.
Still can not make 32bit linux rendering with OSL -- blender simply crashes when
starting rendering. So for time being this issues are solving disabled OSL for
32bit build slaves.
Diffstat (limited to 'build_files/scons/tools')
-rw-r--r-- | build_files/scons/tools/Blender.py | 17 | ||||
-rw-r--r-- | build_files/scons/tools/btools.py | 26 |
2 files changed, 40 insertions, 3 deletions
diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py index a5e47a50d10..23e732370ce 100644 --- a/build_files/scons/tools/Blender.py +++ b/build_files/scons/tools/Blender.py @@ -222,6 +222,16 @@ def setup_staticlibs(lenv): if lenv['WITH_BF_STATICBOOST']: statlibs += Split(lenv['BF_BOOST_LIB_STATIC']) + if lenv['WITH_BF_CYCLES_OSL']: + libincs += Split(lenv['BF_OSL_LIBPATH']) + if lenv['WITH_BF_STATICOSL']: + statlibs += Split(lenv['BF_OSL_LIB_STATIC']) + + if lenv['WITH_BF_LLVM']: + libincs += Split(lenv['BF_LLVM_LIBPATH']) + if lenv['WITH_BF_STATICLLVM']: + statlibs += Split(lenv['BF_LLVM_LIB_STATIC']) + # setting this last so any overriding of manually libs could be handled if lenv['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross', 'win64-mingw'): libincs.append('/usr/lib') @@ -314,6 +324,12 @@ def setup_syslibs(lenv): if lenv['WITH_BF_INTERNATIONAL']: syslibs += Split(lenv['BF_BOOST_LIB_INTERNATIONAL']) + if lenv['WITH_BF_CYCLES_OSL'] and not lenv['WITH_BF_STATICOSL']: + syslibs += Split(lenv['BF_OSL_LIB']) + + if lenv['WITH_BF_LLVM'] and not lenv['WITH_BF_STATICLLVM']: + syslibs += Split(lenv['BF_LLVM_LIB']) + if not lenv['WITH_BF_STATICJPEG']: syslibs += Split(lenv['BF_JPEG_LIB']) @@ -883,6 +899,7 @@ class BlenderEnvironment(SConsEnvironment): print bc.HEADER+'Configuring program '+bc.ENDC+bc.OKGREEN+progname+bc.ENDC lenv = self.Clone() lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS']) + lenv.Append(LINKFLAGS = lenv['BF_PROGRAM_LINKFLAGS']) if lenv['OURPLATFORM'] in ('win32-mingw', 'win64-mingw', 'linuxcross', 'cygwin', 'linux'): lenv.Replace(LINK = '$CXX') if lenv['OURPLATFORM'] in ('win32-vc', 'cygwin', 'win64-vc'): diff --git a/build_files/scons/tools/btools.py b/build_files/scons/tools/btools.py index 4e50f0dc313..5b1c1571bed 100644 --- a/build_files/scons/tools/btools.py +++ b/build_files/scons/tools/btools.py @@ -164,7 +164,9 @@ def validate_arguments(args, bc): 'WITH_BF_OIIO', 'WITH_BF_STATICOIIO', 'BF_OIIO', 'BF_OIIO_INC', 'BF_OIIO_LIB', 'BF_OIIO_LIB_STATIC', 'BF_OIIO_LIBPATH', 'WITH_BF_OCIO', 'WITH_BF_STATICOCIO', 'BF_OCIO', 'BF_OCIO_INC', 'BF_OCIO_LIB', 'BF_OCIO_LIB_STATIC', 'BF_OCIO_LIBPATH', 'WITH_BF_BOOST', 'WITH_BF_STATICBOOST', 'BF_BOOST', 'BF_BOOST_INC', 'BF_BOOST_LIB', 'BF_BOOST_LIB_INTERNATIONAL', 'BF_BOOST_LIB_STATIC', 'BF_BOOST_LIBPATH', - 'WITH_BF_LIBMV' + 'WITH_BF_LIBMV', + 'WITH_BF_CYCLES_OSL', 'WITH_BF_STATICOSL', 'BF_OSL', 'BF_OSL_INC', 'BF_OSL_LIB', 'BF_OSL_LIBPATH', 'BF_OSL_LIB_STATIC', 'BF_OSL_COMPILER', + 'WITH_BF_LLVM', 'WITH_BF_STATICLLVM', 'BF_LLVM', 'BF_LLVM_LIB', 'BF_LLVM_LIBPATH', 'BF_LLVM_LIB_STATIC', 'BF_PROGRAM_LINKFLAGS' ] # Have options here that scons expects to be lists @@ -178,7 +180,7 @@ def validate_arguments(args, bc): 'BF_DEBUG_CFLAGS', 'BF_DEBUG_CCFLAGS', 'BF_DEBUG_CXXFLAGS', 'C_WARN', 'CC_WARN', 'CXX_WARN', 'LLIBS', 'PLATFORM_LINKFLAGS','MACOSX_ARCHITECTURE', 'MACOSX_SDK_CHECK', 'XCODE_CUR_VER', - 'BF_CYCLES_CUDA_BINARIES_ARCH', + 'BF_CYCLES_CUDA_BINARIES_ARCH', 'BF_PROGRAM_LINKFLAGS' ] @@ -595,7 +597,25 @@ def read_opts(env, cfg, args): ('BF_BOOST_LIB_STATIC', 'Boost static library', ''), (BoolVariable('WITH_GHOST_XDND', 'Build with drag-n-drop support on Linux platforms using XDND protocol', True)), - (BoolVariable('WITH_BF_COMPOSITOR_LEGACY', 'Enable the legacy compositor', False)) + (BoolVariable('WITH_BF_COMPOSITOR_LEGACY', 'Enable the legacy compositor', False)), + + (BoolVariable('WITH_BF_CYCLES_OSL', 'Build with OSL sypport in Cycles', False)), + (BoolVariable('WITH_BF_STATICOSL', 'Staticly link to OSL', False)), + ('BF_OSL', 'OSL root path', ''), + ('BF_OSL_INC', 'OSL include path', ''), + ('BF_OSL_LIB', 'OSL library', ''), + ('BF_OSL_LIBPATH', 'OSL library path', ''), + ('BF_OSL_LIB_STATIC', 'OSL static library', ''), + ('BF_OSL_COMPILER', 'OSL compiler', ''), + + (BoolVariable('WITH_BF_LLVM', 'Build with LLVM sypport (required for OSL)', False)), + (BoolVariable('WITH_BF_STATICLLVM', 'Staticly link to LLVM', False)), + ('BF_LLVM', 'LLVM root path', ''), + ('BF_LLVM_LIB', 'LLVM library', ''), + ('BF_LLVM_LIBPATH', 'LLVM library path', ''), + ('BF_LLVM_LIB_STATIC', 'LLVM static library', ''), + + ('BF_PROGRAM_LINKFLAGS', 'Link flags applied only to final binaries (blender and blenderplayer, not makesrna/makesdna)', '') ) # end of opts.AddOptions() return localopts |