[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41682] trunk/blender: Add compiles support for Cycles.

Nathan Letwory nathan at letworyinteractive.com
Tue Nov 8 21:40:03 CET 2011


Revision: 41682
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41682
Author:   jesterking
Date:     2011-11-08 20:40:02 +0000 (Tue, 08 Nov 2011)
Log Message:
-----------
Add compiles support for Cycles.

No CUDA compiling yet, will be added later.

Modified Paths:
--------------
    trunk/blender/SConstruct
    trunk/blender/build_files/scons/config/win32-vc-config.py
    trunk/blender/build_files/scons/config/win64-vc-config.py
    trunk/blender/build_files/scons/tools/Blender.py
    trunk/blender/build_files/scons/tools/btools.py
    trunk/blender/intern/SConscript
    trunk/blender/source/blender/SConscript
    trunk/blender/source/blender/makesrna/SConscript
    trunk/blender/source/blender/python/SConscript

Added Paths:
-----------
    trunk/blender/intern/cycles/SConscript

Modified: trunk/blender/SConstruct
===================================================================
--- trunk/blender/SConstruct	2011-11-08 20:27:37 UTC (rev 41681)
+++ trunk/blender/SConstruct	2011-11-08 20:40:02 UTC (rev 41682)
@@ -435,12 +435,12 @@
 
 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 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 @@
         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)

Modified: trunk/blender/build_files/scons/config/win32-vc-config.py
===================================================================
--- trunk/blender/build_files/scons/config/win32-vc-config.py	2011-11-08 20:27:37 UTC (rev 41681)
+++ trunk/blender/build_files/scons/config/win32-vc-config.py	2011-11-08 20:40:02 UTC (rev 41682)
@@ -149,19 +149,20 @@
 
 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

Modified: trunk/blender/build_files/scons/config/win64-vc-config.py
===================================================================
--- trunk/blender/build_files/scons/config/win64-vc-config.py	2011-11-08 20:27:37 UTC (rev 41681)
+++ trunk/blender/build_files/scons/config/win64-vc-config.py	2011-11-08 20:40:02 UTC (rev 41682)
@@ -153,7 +153,8 @@
 
 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_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

Modified: trunk/blender/build_files/scons/tools/Blender.py
===================================================================
--- trunk/blender/build_files/scons/tools/Blender.py	2011-11-08 20:27:37 UTC (rev 41681)
+++ trunk/blender/build_files/scons/tools/Blender.py	2011-11-08 20:40:02 UTC (rev 41682)
@@ -279,6 +279,11 @@
         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'])

Modified: trunk/blender/build_files/scons/tools/btools.py
===================================================================
--- trunk/blender/build_files/scons/tools/btools.py	2011-11-08 20:27:37 UTC (rev 41681)
+++ trunk/blender/build_files/scons/tools/btools.py	2011-11-08 20:40:02 UTC (rev 41682)
@@ -156,6 +156,7 @@
             '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 @@
 
         ('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', ''),

Modified: trunk/blender/intern/SConscript
===================================================================
--- trunk/blender/intern/SConscript	2011-11-08 20:27:37 UTC (rev 41681)
+++ trunk/blender/intern/SConscript	2011-11-08 20:40:02 UTC (rev 41682)
@@ -24,6 +24,9 @@
 
 if env['WITH_BF_FLUID']:
     SConscript(['elbeem/SConscript'])
+    
+if env['WITH_BF_CYCLES']:
+    SConscript(['cycles/SConscript'])
 
 if NEW_CSG=='false':
     SConscript(['bsp/SConscript'])

Added: trunk/blender/intern/cycles/SConscript
===================================================================
--- trunk/blender/intern/cycles/SConscript	                        (rev 0)
+++ trunk/blender/intern/cycles/SConscript	2011-11-08 20:40:02 UTC (rev 41682)
@@ -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] )
+

Modified: trunk/blender/source/blender/SConscript
===================================================================
--- trunk/blender/source/blender/SConscript	2011-11-08 20:27:37 UTC (rev 41681)
+++ trunk/blender/source/blender/SConscript	2011-11-08 20:40:02 UTC (rev 41682)
@@ -11,7 +11,6 @@
             'editors/SConscript',
             'imbuf/SConscript',
             'makesdna/SConscript',
-            'makesrna/SConscript',

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list