2011-11-08 20:40:02 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
from os import path
|
|
|
|
Import('env')
|
|
|
|
|
|
|
|
cycles = env.Clone()
|
|
|
|
|
|
|
|
cycles.Depends('../../source/blender/makesrna/intern/RNA_blender_cpp.h', 'makesrna')
|
|
|
|
|
2011-11-15 19:23:35 +00:00
|
|
|
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('blender/*.cpp')
|
2011-11-08 20:40:02 +00:00
|
|
|
|
|
|
|
sources.remove(path.join('util', 'util_view.cpp'))
|
|
|
|
sources.remove(path.join('render', 'film_response.cpp'))
|
2011-11-15 15:13:38 +00:00
|
|
|
sources.remove(path.join('kernel', 'kernel_optimized.cpp'))
|
2011-11-08 20:40:02 +00:00
|
|
|
|
|
|
|
incs = []
|
|
|
|
defs = []
|
2012-06-25 11:42:58 +00:00
|
|
|
cxxflags = Split(env['CXXFLAGS'])
|
2011-11-08 20:40:02 +00:00
|
|
|
|
|
|
|
defs.append('CCL_NAMESPACE_BEGIN=namespace ccl {')
|
|
|
|
defs.append('CCL_NAMESPACE_END=}')
|
|
|
|
|
|
|
|
defs.append('WITH_OPENCL')
|
|
|
|
defs.append('WITH_MULTI')
|
|
|
|
defs.append('WITH_CUDA')
|
|
|
|
|
2011-12-01 16:33:21 +00:00
|
|
|
if env['WITH_BF_CYCLES_CUDA_BINARIES']:
|
2011-11-24 19:22:34 +00:00
|
|
|
defs.append('WITH_CUDA_BINARIES')
|
|
|
|
|
2011-11-08 20:40:02 +00:00
|
|
|
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'])
|
|
|
|
|
2011-12-01 16:33:21 +00:00
|
|
|
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
|
|
|
cxxflags.append('-D_CRT_SECURE_NO_WARNINGS /fp:fast /EHsc'.split())
|
|
|
|
else:
|
|
|
|
cxxflags.append('-ffast-math'.split())
|
|
|
|
|
2012-04-24 12:57:58 +00:00
|
|
|
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
|
2012-02-04 19:58:09 +00:00
|
|
|
incs.append(env['BF_PTHREADS_INC'])
|
|
|
|
|
2011-11-15 15:13:38 +00:00
|
|
|
# optimized kernel
|
|
|
|
if env['WITH_BF_RAYOPTIMIZATION']:
|
|
|
|
optim_cxxflags = []
|
|
|
|
|
2012-05-28 09:20:04 +00:00
|
|
|
if env['OURPLATFORM'] == 'win32-vc':
|
2011-12-01 16:33:21 +00:00
|
|
|
optim_cxxflags.append('/arch:SSE2 -D_CRT_SECURE_NO_WARNINGS /fp:fast /EHsc'.split())
|
2012-05-28 09:20:04 +00:00
|
|
|
elif env['OURPLATFORM'] == 'win64-vc':
|
|
|
|
optim_cxxflags.append('-D_CRT_SECURE_NO_WARNINGS /fp:fast /EHsc'.split())
|
2011-11-15 15:13:38 +00:00
|
|
|
else:
|
2011-12-02 14:26:28 +00:00
|
|
|
optim_cxxflags.append('-ffast-math -msse -msse2 -msse3 -mfpmath=sse'.split())
|
2011-11-15 15:13:38 +00:00
|
|
|
|
2011-12-02 14:26:28 +00:00
|
|
|
defs.append('WITH_OPTIMIZED_KERNEL')
|
|
|
|
optim_defs = defs[:]
|
2011-11-15 15:13:38 +00:00
|
|
|
optim_sources = [path.join('kernel', 'kernel_optimized.cpp')]
|
|
|
|
|
|
|
|
cycles_optim = cycles.Clone()
|
2012-06-25 11:42:58 +00:00
|
|
|
cycles_optim.BlenderLib('bf_intern_cycles_optimized', optim_sources, incs, optim_defs, libtype=['intern'], priority=[10], cxx_compileflags=optim_cxxflags)
|
2011-11-15 15:13:38 +00:00
|
|
|
|
2012-06-25 11:42:58 +00:00
|
|
|
cycles.BlenderLib('bf_intern_cycles', sources, incs, defs, libtype=['intern'], priority=[0], cxx_compileflags=cxxflags)
|
2011-12-01 16:33:21 +00:00
|
|
|
|
|
|
|
# cuda kernel binaries
|
|
|
|
if env['WITH_BF_CYCLES_CUDA_BINARIES']:
|
|
|
|
kernel_binaries = SConscript(['kernel/SConscript'])
|
|
|
|
cycles.Depends("device/device_cuda.o", kernel_binaries)
|
2011-11-08 20:40:02 +00:00
|
|
|
|