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