image format arg parsing for creator.c
[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
18 defs.append('CCL_NAMESPACE_BEGIN=namespace ccl {')
19 defs.append('CCL_NAMESPACE_END=}')
20
21 defs.append('WITH_OPENCL')
22 defs.append('WITH_MULTI')
23 defs.append('WITH_CUDA')
24
25 incs.extend('. bvh render device kernel kernel/osl kernel/svm util subd'.split())
26 incs.extend('#intern/guardedalloc #source/blender/makesrna #source/blender/makesdna'.split())
27 incs.extend('#source/blender/blenloader ../../source/blender/makesrna/intern'.split())
28 incs.extend('#extern/glew/include'.split())
29 incs.append(cycles['BF_OIIO_INC'])
30 incs.append(cycles['BF_BOOST_INC'])
31 incs.append(cycles['BF_PYTHON_INC'])
32
33 # optimized kernel
34 if env['WITH_BF_RAYOPTIMIZATION']:
35     optim_cxxflags = []
36
37     if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
38         optim_cxxflags.append('/Ox /Ot /arch:SSE2 -D_CRT_SECURE_NO_WARNINGS /EHsc /fp:fast'.split())
39     else:
40         optim_cxxflags.append('-ffast-math -msse -msse2 -msse3'.split())
41     
42     optim_defs = defs + ['WITH_OPTIMIZED_KERNEL']
43     optim_sources = [path.join('kernel', 'kernel_optimized.cpp')]
44
45     cycles_optim = cycles.Clone()
46     cycles_optim.BlenderLib('bf_intern_cycles_optimized', optim_sources, incs, optim_defs, libtype=['intern'], priority=[0], compileflags=[None], cxx_compileflags=optim_cxxflags)
47
48 cycles.BlenderLib('bf_intern_cycles', sources, incs, defs, libtype=['intern'], priority=[0], compileflags=[None])
49