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