Scons ToDo:
[blender.git] / source / blender / blenkernel / SConscript
1 #!/usr/bin/python
2 Import ('env')
3 import os
4
5 sources = env.Glob('intern/*.c')
6
7 incs = '. #/intern/guardedalloc #/intern/memutil'
8 incs += ' ../blenlib ../blenfont ../makesdna ../windowmanager'
9 incs += ' ../render/extern/include #/intern/decimation/extern ../makesrna'
10 incs += ' ../imbuf ../ikplugin ../avi #/intern/elbeem/extern ../nodes ../modifiers'
11 incs += ' #/intern/iksolver/extern ../blenloader'
12 incs += ' #/extern/bullet2/src'
13 incs += ' #/intern/opennl/extern #/intern/bsp/extern'
14 incs += ' ../gpu #/extern/glew/include'
15 incs += ' ../bmesh'
16 incs += ' #/intern/smoke/extern'
17 incs += ' #/intern/mikktspace'
18 incs += ' #/intern/audaspace/intern'
19 incs += ' #/intern/ffmpeg'
20
21 incs += ' ' + env['BF_OPENGL_INC']
22 incs += ' ' + env['BF_ZLIB_INC']
23
24 defs = [ 'GLEW_STATIC' ]
25
26 if env['WITH_BF_SMOKE']:
27     defs.append('WITH_SMOKE')
28
29 if env['WITH_BF_FRAMESERVER']:
30     defs.append('WITH_FRAMESERVER')
31
32 if env['WITH_BF_PYTHON']:
33     incs += ' ../python'
34     incs += ' ' + env['BF_PYTHON_INC']
35     defs.append('WITH_PYTHON')
36     if env['BF_DEBUG']:
37         defs.append('DEBUG')
38
39 if env['WITH_BF_ELTOPO']:
40     incs += ' ../../../extern/eltopo'
41     defs.append('WITH_ELTOPO')
42         
43 if env['WITH_BF_QUICKTIME']:
44     incs += ' ../quicktime'
45
46 if env['WITH_BF_SDL']:
47     incs += ' ' + env['BF_SDL_INC']
48     defs.append('WITH_SDL')
49
50 if env['WITH_BF_OPENEXR']:
51     defs.append('WITH_OPENEXR')
52
53 if env['WITH_BF_TIFF']:
54     defs.append('WITH_TIFF')
55
56 if env['WITH_BF_OPENJPEG']:
57     defs.append('WITH_OPENJPEG')
58
59 if env['WITH_BF_DDS']:
60     defs.append('WITH_DDS')
61
62 if env['WITH_BF_CINEON']:
63     defs.append('WITH_CINEON')
64
65 if env['WITH_BF_HDR']:
66     defs.append('WITH_HDR')
67
68 if env['WITH_BF_JACK']:
69     defs.append('WITH_JACK')
70
71 if env['WITH_BF_FFMPEG']:
72     defs.append('WITH_FFMPEG')
73     incs += ' ' + env['BF_FFMPEG_INC']
74
75 if env['WITH_BF_QUICKTIME']:
76     defs.append('WITH_QUICKTIME')
77     incs += ' ' + env['BF_QUICKTIME_INC']
78
79 if env['WITH_BF_BULLET']:
80     defs.append('USE_BULLET')
81
82 if env['OURPLATFORM'] == 'darwin':
83     if env['WITH_BF_OPENMP']:
84        defs.append('PARALLEL=1')
85
86 if env['WITH_BF_FLUID']:
87     defs.append('WITH_MOD_FLUID')
88
89 if env['WITH_BF_OCEANSIM']:
90     defs.append('WITH_OCEANSIM')
91
92 if env['WITH_BF_LZO']:
93     incs += ' #/extern/lzo/minilzo'
94     defs.append('WITH_LZO')
95
96 if env['WITH_BF_LZMA']:
97     incs += ' #/extern/lzma'
98     defs.append('WITH_LZMA')
99
100 if env['WITH_BF_GAMEENGINE']:
101     incs += ' #/extern/recastnavigation'
102     defs.append('WITH_GAMEENGINE')
103 else:
104     sources.remove('intern' + os.sep + 'navmesh_conversion.c')
105
106 if env['WITH_BF_LIBMV']:
107     incs += ' #/extern/libmv'
108     defs.append('WITH_LIBMV')
109
110 if env['WITH_BF_FFTW3']:
111     defs.append('FFTW3=1')
112     incs += ' ' + env['BF_FFTW3_INC'] 
113
114 if env['WITH_BF_INTERNATIONAL']:
115     defs.append('WITH_INTERNATIONAL')
116
117 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
118     incs += ' ' + env['BF_PTHREADS_INC']
119
120 if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
121     env.BlenderLib ( libname = 'bf_blenkernel', sources = sources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [166,25]) #, cc_compileflags = env['CCFLAGS'].append('/WX') )
122 else:
123     env.BlenderLib ( libname = 'bf_blenkernel', sources = sources, includes = Split(incs), defines = defs, libtype=['core','player', 'player2'], priority = [166,25,0] )