Merged changes in the trunk up to revision 26719.
[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 ../radiosity/extern/include ../imbuf'
9 incs += ' ../include ../blenloader ../freestyle ../../../intern/smoke/extern'
10
11 cflags = env['CCFLAGS']
12 cxxflags = env['CXXFLAGS']
13
14 defs = []
15
16 if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
17     if env['WITH_BF_RAYOPTIMIZATION']:
18         cflags = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
19         cxxflags = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
20
21 if env['OURPLATFORM'] == 'win32-mingw':
22     if env['WITH_BF_RAYOPTIMIZATION']:
23         cflags = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
24         cxxflags = env['CXXFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
25
26 if env['OURPLATFORM'] == 'darwin':
27     if env['MACOSX_ARCHITECTURE'] in ('i386', 'x86_64') and env['WITH_BF_RAYOPTIMIZATION']:
28         cflags = env['CFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
29         cxxflags = env['CXXFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
30         
31 if env['OURPLATFORM'] == 'linux2':
32     if env['WITH_BF_RAYOPTIMIZATION']:
33         cflags = env['CCFLAGS'] +  env['BF_RAYOPTIMIZATION_SSE_FLAGS']
34         cxxflags = env['CXXFLAGS'] +  env['BF_RAYOPTIMIZATION_SSE_FLAGS']
35     incs += ' ../../../extern/binreloc/include'
36
37 if env['OURPLATFORM'] == 'linuxcross':
38     if env['WITH_BF_RAYOPTIMIZATION']:
39         cflags = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
40         cxxflags = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
41
42 if env['WITH_BF_QUICKTIME']:
43     defs.append('WITH_QUICKTIME')
44     incs += ' ../quicktime ' + env['BF_QUICKTIME_INC']
45
46 if env['WITH_BF_OPENEXR']:
47     defs.append('WITH_OPENEXR')
48
49 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
50     incs += ' ' + env['BF_PTHREADS_INC']
51
52 #
53 # HACK: To fix problem with error 'MMX instruction set not enabled' from mmintrin.h
54 #
55 if env['OURPLATFORM'] == 'linuxcross':
56     defs.append('__MMX__')
57
58 if env['WITH_BF_RAYOPTIMIZATION']:
59     defs.append('__SSE__')
60
61 env.BlenderLib ( libname = 'bf_render', sources = sources, includes = Split(incs), defines=defs, libtype='core', priority=145, compileflags=cflags )
62 env.BlenderLib ( libname = 'bf_render_raytrace', sources = raysources, includes = Split(incs), defines=defs, libtype='core', priority=145, compileflags=cflags, cxx_compileflags=cxxflags )