Cycles: svn merge -r39457:39669 https://svn.blender.org/svnroot/bf-blender/trunk...
[blender-staging.git] / source / blender / render / SConscript
1 #!/usr/bin/python
2 Import ('env')
3
4 sources = env.Glob('intern/source/*.c') + env.Glob('intern/pipeline/*.c')
5 raysources = env.Glob('intern/raytrace/*.cpp')
6
7 incs = 'intern/include #/intern/guardedalloc ../blenlib ../makesdna ../makesrna'
8 incs += ' extern/include ../blenkernel ../radiosity/extern/include ../imbuf'
9 incs += ' ../include ../blenloader ../../../intern/smoke/extern ../../../intern/mikktspace'
10
11 cflags_raytrace = env['CCFLAGS']
12 cxxflags_raytrace = env['CXXFLAGS']
13
14 defs = []
15 defs_raytrace = []
16
17 defs.append('WITH_SMOKE')  # TODO, make optional
18
19 if env['WITH_BF_PYTHON']:
20     incs += ' ../python'
21     incs += ' ' + env['BF_PYTHON_INC']
22     defs.append('WITH_PYTHON')
23     if env['BF_DEBUG']:
24         defs.append('DEBUG')
25
26 if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
27     if env['WITH_BF_RAYOPTIMIZATION']:
28         cflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
29         cxxflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
30
31 if env['OURPLATFORM'] == 'win32-mingw':
32     if env['WITH_BF_RAYOPTIMIZATION']:
33         cflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
34         cxxflags_raytrace = env['CXXFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
35
36 if env['OURPLATFORM'] == 'darwin':
37     if env['MACOSX_ARCHITECTURE'] in ('i386', 'x86_64') and env['WITH_BF_RAYOPTIMIZATION']:
38         cflags_raytrace = env['CFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
39         cxxflags_raytrace = env['CXXFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
40         
41 if env['OURPLATFORM'] == 'linux':
42     if env['WITH_BF_RAYOPTIMIZATION']:
43         cflags_raytrace = env['CCFLAGS'] +  env['BF_RAYOPTIMIZATION_SSE_FLAGS']
44         cxxflags_raytrace = env['CXXFLAGS'] +  env['BF_RAYOPTIMIZATION_SSE_FLAGS']
45     incs += ' ../../../extern/binreloc/include'
46
47 if env['OURPLATFORM'] == 'linuxcross':
48     if env['WITH_BF_RAYOPTIMIZATION']:
49         cflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
50         cxxflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
51
52 if env['WITH_BF_QUICKTIME']:
53     defs.append('WITH_QUICKTIME')
54     incs += ' ../quicktime ' + env['BF_QUICKTIME_INC']
55
56 if env['WITH_BF_OPENEXR']:
57     defs.append('WITH_OPENEXR')
58
59 if env['WITH_BF_GAMEENGINE']:
60     defs.append('WITH_GAMEENGINE')
61
62 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
63     incs += ' ' + env['BF_PTHREADS_INC']
64
65 #
66 # HACK: To fix problem with error 'MMX instruction set not enabled' from mmintrin.h
67 #
68 if env['OURPLATFORM'] == 'linuxcross':
69     defs.append('__SSE__')
70     defs_raytrace.append('__MMX__')
71
72 if env['WITH_BF_RAYOPTIMIZATION']:
73     defs.append('__SSE__')
74     defs_raytrace.append('__SSE__')
75
76 env.BlenderLib ( libname = 'bf_render', sources = sources, includes = Split(incs), defines=defs, libtype='core', priority=145 )
77 env.BlenderLib ( libname = 'bf_render_raytrace', sources = raysources, includes = Split(incs), defines=defs_raytrace, libtype='core', priority=145, compileflags=cflags_raytrace, cxx_compileflags=cxxflags_raytrace )