Welcome to mirror list, hosted at ThFree Co, Russian Federation.

SConscript « cycles « intern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1a127e364fe90b8a31b91aa6c1e97d4911e9a943 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/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('blender/*.cpp')

sources.remove(path.join('util', 'util_view.cpp'))
sources.remove(path.join('render', 'film_response.cpp'))
sources.remove(path.join('kernel', 'kernel_optimized.cpp'))

incs = [] 
defs = []
cxxflags = Split(env['CXXFLAGS'])

defs.append('CCL_NAMESPACE_BEGIN=namespace ccl {')
defs.append('CCL_NAMESPACE_END=}')

defs.append('WITH_OPENCL')
defs.append('WITH_MULTI')
defs.append('WITH_CUDA')

if env['WITH_BF_CYCLES_OSL']:
    defs.append('WITH_OSL')
    incs.append(cycles['BF_OSL_INC'])

if env['WITH_BF_CYCLES_CUDA_BINARIES']:
    defs.append('WITH_CUDA_BINARIES')

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 #intern/mikktspace'.split())
incs.append(cycles['BF_OIIO_INC'])
incs.append(cycles['BF_BOOST_INC'])
incs.append(cycles['BF_OPENEXR_INC'].split())
incs.extend(cycles['BF_PYTHON_INC'].split())

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())

if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
    incs.append(env['BF_PTHREADS_INC'])

# optimized kernel
if env['WITH_BF_RAYOPTIMIZATION']:
    optim_cxxflags = []

    if env['OURPLATFORM'] == 'win32-vc':
        optim_cxxflags.append('/arch:SSE2 -D_CRT_SECURE_NO_WARNINGS /fp:fast /EHsc'.split())
    elif env['OURPLATFORM'] == 'win64-vc':
        optim_cxxflags.append('-D_CRT_SECURE_NO_WARNINGS /fp:fast /EHsc'.split())
    else:
        optim_cxxflags.append('-ffast-math -msse -msse2 -msse3 -mfpmath=sse'.split())
    
    defs.append('WITH_OPTIMIZED_KERNEL')
    optim_defs = defs[:]
    optim_sources = [path.join('kernel', 'kernel_optimized.cpp')]

    cycles_optim = cycles.Clone()
    cycles_optim.BlenderLib('bf_intern_cycles_optimized', optim_sources, incs, optim_defs, libtype=['intern'], priority=[10], cxx_compileflags=optim_cxxflags)

cycles.BlenderLib('bf_intern_cycles', sources, incs, defs, libtype=['intern'], priority=[0], cxx_compileflags=cxxflags)

if env['WITH_BF_CYCLES_OSL']:
    oso_files = SConscript(['kernel/shaders/SConscript'])
    cycles.Depends("kernel/osl/osl_shader.o", oso_files)

    SConscript(['kernel/osl/SConscript'])

# cuda kernel binaries
if env['WITH_BF_CYCLES_CUDA_BINARIES']:
    kernel_binaries = SConscript(['kernel/SConscript'])
    cycles.Depends("device/device_cuda.o", kernel_binaries)