Brightness/Contrast Node for Cycles
[blender.git] / intern / cycles / SConscript
1 #!/usr/bin/python
2 from os import path
3 Import('env')
4
5 cycles = env.Clone()
6
7 cycles.Depends('../../source/blender/makesrna/intern/RNA_blender_cpp.h', 'makesrna')
8
9 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')
10
11 sources.remove(path.join('util', 'util_view.cpp'))
12 sources.remove(path.join('render', 'film_response.cpp'))
13 sources.remove(path.join('kernel', 'kernel_optimized.cpp'))
14
15 incs = [] 
16 defs = []
17 cxxflags = []
18
19 defs.append('CCL_NAMESPACE_BEGIN=namespace ccl {')
20 defs.append('CCL_NAMESPACE_END=}')
21
22 defs.append('WITH_OPENCL')
23 defs.append('WITH_MULTI')
24 defs.append('WITH_CUDA')
25
26 if env['WITH_BF_CYCLES_CUDA_BINARIES']:
27     defs.append('WITH_CUDA_BINARIES')
28
29 incs.extend('. bvh render device kernel kernel/osl kernel/svm util subd'.split())
30 incs.extend('#intern/guardedalloc #source/blender/makesrna #source/blender/makesdna'.split())
31 incs.extend('#source/blender/blenloader ../../source/blender/makesrna/intern'.split())
32 incs.extend('#extern/glew/include'.split())
33 incs.append(cycles['BF_OIIO_INC'])
34 incs.append(cycles['BF_BOOST_INC'])
35 incs.append(cycles['BF_PYTHON_INC'])
36
37 if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
38     cxxflags.append('-D_CRT_SECURE_NO_WARNINGS /fp:fast /EHsc'.split())
39 else:
40     cxxflags.append('-ffast-math'.split())
41
42 # optimized kernel
43 if env['WITH_BF_RAYOPTIMIZATION']:
44     optim_cxxflags = []
45
46     if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
47         optim_cxxflags.append('/arch:SSE2 -D_CRT_SECURE_NO_WARNINGS /fp:fast /EHsc'.split())
48     else:
49         optim_cxxflags.append('-ffast-math -msse -msse2 -msse3 -mfpmath=sse'.split())
50     
51     defs.append('WITH_OPTIMIZED_KERNEL')
52     optim_defs = defs[:]
53     optim_sources = [path.join('kernel', 'kernel_optimized.cpp')]
54
55     cycles_optim = cycles.Clone()
56     cycles_optim.BlenderLib('bf_intern_cycles_optimized', optim_sources, incs, optim_defs, libtype=['intern'], priority=[10], compileflags=[None], cxx_compileflags=optim_cxxflags)
57
58 cycles.BlenderLib('bf_intern_cycles', sources, incs, defs, libtype=['intern'], priority=[0], compileflags=[None], cxx_compileflags=cxxflags)
59
60 # cuda kernel binaries
61 if env['WITH_BF_CYCLES_CUDA_BINARIES']:
62     kernel_binaries = SConscript(['kernel/SConscript'])
63     cycles.Depends("device/device_cuda.o", kernel_binaries)
64