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