Add compiles support for Cycles.
authorNathan Letwory <nathan@letworyinteractive.com>
Tue, 8 Nov 2011 20:40:02 +0000 (20:40 +0000)
committerNathan Letwory <nathan@letworyinteractive.com>
Tue, 8 Nov 2011 20:40:02 +0000 (20:40 +0000)
No CUDA compiling yet, will be added later.

SConstruct
build_files/scons/config/win32-vc-config.py
build_files/scons/config/win64-vc-config.py
build_files/scons/tools/Blender.py
build_files/scons/tools/btools.py
intern/SConscript
intern/cycles/SConscript [new file with mode: 0644]
source/blender/SConscript
source/blender/makesrna/SConscript
source/blender/python/SConscript

index 16ce8ca4b32237dc169a6a9f9fc39a93845c3e45..5bc76c57091f438548dc3fa5b63b60baa8ddd26f 100644 (file)
@@ -435,12 +435,12 @@ B.init_lib_dict()
 
 Export('env')
 
+BuildDir(B.root_build_dir+'/source', 'source', duplicate=0)
+SConscript(B.root_build_dir+'/source/SConscript')
 BuildDir(B.root_build_dir+'/intern', 'intern', duplicate=0)
 SConscript(B.root_build_dir+'/intern/SConscript')
 BuildDir(B.root_build_dir+'/extern', 'extern', duplicate=0)
 SConscript(B.root_build_dir+'/extern/SConscript')
-BuildDir(B.root_build_dir+'/source', 'source', duplicate=0)
-SConscript(B.root_build_dir+'/source/SConscript')
 
 # now that we have read all SConscripts, we know what
 # libraries will be built. Create list of
@@ -526,6 +526,50 @@ if env['OURPLATFORM']!='darwin':
                 if len(source)==0:
                     env.Execute(Mkdir(dir))
                 scriptinstall.append(env.Install(dir=dir,source=source))
+        if env['WITH_BF_CYCLES']:
+            # cycles python code
+            dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles')
+            source=os.listdir('intern/cycles/blender/addon')
+            if '.svn' in source: source.remove('.svn')
+            if '_svn' in source: source.remove('_svn')
+            if '__pycache__' in source: source.remove('__pycache__')
+            source=['intern/cycles/blender/addon/'+s for s in source]
+            scriptinstall.append(env.Install(dir=dir,source=source))
+
+            # cycles kernel code
+            dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'kernel')
+            source=os.listdir('intern/cycles/kernel')
+            if '.svn' in source: source.remove('.svn')
+            if '_svn' in source: source.remove('_svn')
+            if '__pycache__' in source: source.remove('__pycache__')
+            source.remove('kernel.cpp')
+            source.remove('CMakeLists.txt')
+            source.remove('svm')
+            source.remove('osl')
+            source=['intern/cycles/kernel/'+s for s in source]
+            source.append('intern/cycles/util/util_color.h')
+            source.append('intern/cycles/util/util_math.h')
+            source.append('intern/cycles/util/util_transform.h')
+            source.append('intern/cycles/util/util_types.h')
+            scriptinstall.append(env.Install(dir=dir,source=source))
+            # svm
+            dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'kernel', 'svm')
+            source=os.listdir('intern/cycles/kernel/svm')
+            if '.svn' in source: source.remove('.svn')
+            if '_svn' in source: source.remove('_svn')
+            if '__pycache__' in source: source.remove('__pycache__')
+            source=['intern/cycles/kernel/svm/'+s for s in source]
+            scriptinstall.append(env.Install(dir=dir,source=source))
+
+            # licenses
+            dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'license')
+            source=os.listdir('intern/cycles/doc/license')
+            if '.svn' in source: source.remove('.svn')
+            if '_svn' in source: source.remove('_svn')
+            if '__pycache__' in source: source.remove('__pycache__')
+            source.remove('CMakeLists.txt')
+            source=['intern/cycles/doc/license/'+s for s in source]
+            scriptinstall.append(env.Install(dir=dir,source=source))
     
     if env['WITH_BF_INTERNATIONAL']:
         internationalpaths=['release' + os.sep + 'datafiles']
@@ -696,6 +740,9 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
         dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb.dll') 
     dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb64.dll')
 
+    if env['WITH_BF_OIIO']:
+        dllsources.append('${LCGDIR}/openimageio/bin/OpenImageIO.dll')
+
     dllsources.append('#source/icons/blender.exe.manifest')
 
     windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
index 1e4821180d619cce355691316af23c77503b36dc..20d4cdbf797eea47c3b6fcb655153c0e3d7b341e 100644 (file)
@@ -149,19 +149,20 @@ WITH_BF_3DMOUSE = True
 
 WITH_BF_OPENMP = True
 
-'''
+#Cycles
+WITH_BF_CYCLES = True 
+
 WITH_BF_OIIO = True
 BF_OIIO = LIBDIR + '/openimageio'
-BF_OIIO_INC = '${BF_OIIO}/include'
+BF_OIIO_INC = '#../lib/windows/openimageio/include'
 BF_OIIO_LIB = 'OpenImageIO'
-BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
+BF_OIIO_LIBPATH = '#../lib/windows/openimageio/lib'
 
 WITH_BF_BOOST = True
 BF_BOOST = LIBDIR + '/boost'
-BF_BOOST_INC = '${BF_BOOST}/include'
+BF_BOOST_INC = '#../lib/windows/boost/include'
 BF_BOOST_LIB = 'libboost_date_time-vc90-mt-s-1_46_1 libboost_filesystem-vc90-mt-s-1_46_1 libboost_regex-vc90-mt-s-1_46_1 libboost_system-vc90-mt-s-1_46_1 libboost_thread-vc90-mt-s-1_46_1'
-BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
-'''
+BF_BOOST_LIBPATH = '#../lib/windows/boost/lib'
 
 #Ray trace optimization
 WITH_BF_RAYOPTIMIZATION = True
index 0920d9375ae33c5a43795dbff8caf2d7f58065aa..051e4b0cc103802b250f4f3994cf16b578dfab58 100644 (file)
@@ -153,7 +153,8 @@ WITH_BF_3DMOUSE = True
 
 WITH_BF_OPENMP = True
 
-'''
+WITH_BF_CYCLES = True
+
 WITH_BF_OIIO = True
 BF_OIIO = LIBDIR + '/openimageio'
 BF_OIIO_INC = '${BF_OIIO}/include'
@@ -165,7 +166,6 @@ BF_BOOST = LIBDIR + '/boost'
 BF_BOOST_INC = '${BF_BOOST}/include'
 BF_BOOST_LIB = 'libboost_date_time-vc90-mt-s-1_45 libboost_filesystem-vc90-mt-s-1_45 libboost_regex-vc90-mt-s-1_45 libboost_system-vc90-mt-s-1_45 libboost_thread-vc90-mt-s-1_45'
 BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
-'''
 
 #Ray trace optimization
 WITH_BF_RAYOPTIMIZATION = True
index ba15f1c1c09a9e5415448b123233c8a8c87a788f..ceadd03139344bd7be0a5914acf220f6f68e1073 100644 (file)
@@ -279,6 +279,11 @@ def setup_syslibs(lenv):
         if lenv['WITH_BF_3DMOUSE']:
             if not lenv['WITH_BF_STATIC3DMOUSE']:
                 syslibs += Split(lenv['BF_3DMOUSE_LIB'])
+                
+    if lenv['WITH_BF_OIIO']:
+        syslibs += Split(lenv['BF_OIIO_LIB'])
+    if lenv['WITH_BF_BOOST']:
+        syslibs += Split(lenv['BF_BOOST_LIB'])
 
     if lenv['WITH_BF_OIIO']:
         syslibs += Split(lenv['BF_OIIO_LIB'])
index 5c78dc646bb1980a50290d858fe5aae16d2fd6f5..6686b9486313a7bf477e63581457c10347dea3cd 100644 (file)
@@ -156,6 +156,7 @@ def validate_arguments(args, bc):
             'WITH_BF_JEMALLOC', 'WITH_BF_STATICJEMALLOC', 'BF_JEMALLOC', 'BF_JEMALLOC_INC', 'BF_JEMALLOC_LIBPATH', 'BF_JEMALLOC_LIB', 'BF_JEMALLOC_LIB_STATIC',
             'BUILDBOT_BRANCH',
             'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC',
+            'WITH_BF_CYCLES',
             'WITH_BF_OIIO', 'BF_OIIO', 'BF_OIIO_INC', 'BF_OIIO_LIB', 'BF_OIIO_LIBPATH',
             'WITH_BF_BOOST', 'BF_BOOST', 'BF_BOOST_INC', 'BF_BOOST_LIB', 'BF_BOOST_LIBPATH'
             ]
@@ -537,6 +538,8 @@ def read_opts(env, cfg, args):
 
         ('BUILDBOT_BRANCH', 'Buildbot branch name', ''),
         
+        (BoolVariable('WITH_BF_CYCLES', 'Build with the Cycles engine', True)),
+        
         (BoolVariable('WITH_BF_OIIO', 'Build with OpenImageIO', False)),
         ('BF_OIIO_INC', 'OIIO include path', ''),
         ('BF_OIIO_LIB', 'OIIO library', ''),
index da245c78776a5f503bf9faab684be47485f64887..c13714543cbeee9518c5bd88023a8898036948eb 100644 (file)
@@ -24,6 +24,9 @@ NEW_CSG='false'
 
 if env['WITH_BF_FLUID']:
     SConscript(['elbeem/SConscript'])
+    
+if env['WITH_BF_CYCLES']:
+    SConscript(['cycles/SConscript'])
 
 if NEW_CSG=='false':
     SConscript(['bsp/SConscript'])
diff --git a/intern/cycles/SConscript b/intern/cycles/SConscript
new file mode 100644 (file)
index 0000000..dbaf52f
--- /dev/null
@@ -0,0 +1,33 @@
+#!/usr/bin/python
+from os import path
+Import('env')
+
+cycles = env.Clone()
+
+cycles.Depends('../../source/blender/makesrna/intern/RNA_blender_cpp.h', 'makesrna')
+
+sources = cycles.Glob('bvh/*.cpp') + cycles.Glob('device/*.cpp') + cycles.Glob('kernel/*.cpp') + cycles.Glob('render/*.cpp') + cycles.Glob('subd/*.cpp') + cycles.Glob('util/*.cpp') + cycles.Glob('util/*.c') + cycles.Glob('blender/*.cpp')
+
+sources.remove(path.join('util', 'util_view.cpp'))
+sources.remove(path.join('render', 'film_response.cpp'))
+
+incs = [] 
+defs = []
+
+defs.append('CCL_NAMESPACE_BEGIN=namespace ccl {')
+defs.append('CCL_NAMESPACE_END=}')
+
+defs.append('WITH_OPENCL')
+defs.append('WITH_MULTI')
+defs.append('WITH_CUDA')
+
+incs.extend('. bvh render device kernel kernel/osl kernel/svm util subd'.split())
+incs.extend('#intern/guardedalloc #source/blender/makesrna #source/blender/makesdna'.split())
+incs.extend('#source/blender/blenloader ../../source/blender/makesrna/intern'.split())
+incs.extend('#extern/glew/include'.split())
+incs.append(cycles['BF_OIIO_INC'])
+incs.append(cycles['BF_BOOST_INC'])
+incs.append(cycles['BF_PYTHON_INC'])
+
+cycles.BlenderLib('bf_intern_cycles', sources, incs, defs, libtype=['intern'], priority=[0] )
+
index 969bd2966fcb0f1e44410f3729d539f7894bb5d8..ea5101f811110ff08d48cff99a450243e8efe895 100644 (file)
@@ -11,7 +11,6 @@ SConscript(['avi/SConscript',
             'editors/SConscript',
             'imbuf/SConscript',
             'makesdna/SConscript',
-            'makesrna/SConscript',
             'render/SConscript',
             'nodes/SConscript',
             'modifiers/SConscript',
@@ -19,7 +18,7 @@ SConscript(['avi/SConscript',
             'windowmanager/SConscript',
             'blenfont/SConscript'])
 
-
+makesrna = SConscript('makesrna/SConscript')
 
 if env['WITH_BF_PYTHON']:
     SConscript(['python/SConscript'])
index da186a57c8bbcbfae0f438ffe996ce5d841a2546..769ec880a65178a97c5ebe8c3cc03abc7d1b2e0c 100644 (file)
@@ -65,4 +65,6 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
 if env['WITH_BF_INTERNATIONAL']:
     defs.append('WITH_INTERNATIONAL')
 
-env.BlenderLib ( 'bf_rna', objs, Split(incs), defines=defs, libtype=['core','player'], priority = [165,20] )
+rnalib = env.BlenderLib ( 'bf_rna', objs, Split(incs), defines=defs, libtype=['core','player'], priority = [165,20] )
+
+Return ('rnalib')
index 3f47038687a059f0543d74f2809718101083811d..c592e87f3b9757eb5e7389b7682f7ed970da51e0 100644 (file)
@@ -43,5 +43,8 @@ if env['BF_BUILDINFO']:
 if env['WITH_BF_INTERNATIONAL']:
     defs.append('WITH_INTERNATIONAL')
 
+if env['WITH_BF_CYCLES']:
+    defs.append('WITH_CYCLES')
+
 sources = env.Glob('intern/*.c')
 env.BlenderLib( libname = 'bf_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core'], priority = [361])