Image thread safe improvements
[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 ../imbuf ../blenfont'
9 incs += ' ../include ../blenloader ../../../intern/smoke/extern ../../../intern/mikktspace ../bmesh'
10
11 cflags_raytrace = env['CCFLAGS']
12 cxxflags_raytrace = env['CXXFLAGS']
13
14 defs = []
15 defs_raytrace = []
16
17 if env['WITH_BF_SMOKE']:
18     defs.append('WITH_SMOKE')
19
20 if env['WITH_BF_PYTHON']:
21     incs += ' ../python'
22     incs += ' ' + env['BF_PYTHON_INC']
23     defs.append('WITH_PYTHON')
24     if env['BF_DEBUG']:
25         defs.append('DEBUG')
26
27 if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
28     if env['WITH_BF_RAYOPTIMIZATION']:
29         cflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
30         cxxflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
31
32 if env['OURPLATFORM'] in ('win32-mingw', 'win64-mingw'):
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
37 if env['OURPLATFORM'] == 'darwin':
38     if env['MACOSX_ARCHITECTURE'] in ('i386', 'x86_64') and env['WITH_BF_RAYOPTIMIZATION']:
39         cflags_raytrace = env['CFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
40         cxxflags_raytrace = env['CXXFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
41         
42 if env['OURPLATFORM'] == 'linux':
43     if env['WITH_BF_RAYOPTIMIZATION']:
44         cflags_raytrace = env['CCFLAGS'] +  env['BF_RAYOPTIMIZATION_SSE_FLAGS']
45         cxxflags_raytrace = env['CXXFLAGS'] +  env['BF_RAYOPTIMIZATION_SSE_FLAGS']
46     incs += ' ../../../extern/binreloc/include'
47
48 if env['OURPLATFORM'] == 'linuxcross':
49     if env['WITH_BF_RAYOPTIMIZATION']:
50         cflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
51         cxxflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
52
53 if env['WITH_BF_QUICKTIME']:
54     defs.append('WITH_QUICKTIME')
55     incs += ' ../quicktime ' + env['BF_QUICKTIME_INC']
56
57 if env['WITH_BF_OPENEXR']:
58     defs.append('WITH_OPENEXR')
59
60 if env['WITH_BF_GAMEENGINE']:
61     defs.append('WITH_GAMEENGINE')
62
63 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
64     incs += ' ' + env['BF_PTHREADS_INC']
65
66 #
67 # HACK: To fix problem with error 'MMX instruction set not enabled' from mmintrin.h
68 #
69 if env['OURPLATFORM'] == 'linuxcross':
70     defs.append('__SSE__')
71     defs_raytrace.append('__MMX__')
72
73 if env['WITH_BF_RAYOPTIMIZATION']:
74     defs.append('__SSE__')
75     defs_raytrace.append('__SSE__')
76
77 env.BlenderLib ( libname = 'bf_render', sources = sources, includes = Split(incs), defines=defs, libtype='core', priority=145 )
78 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 )