[#18164] jpeg2000 patch, with some fixes from Peter too.
[blender.git] / source / blender / src / SConscript
1 #!/usr/bin/python
2 Import ('env')
3
4 # TODO: src_env.Append (CCFLAGS = user_options_dict['SDL_CFLAGS'])
5
6 sources = env.Glob('*.c')
7
8 if env['BF_SPLIT_SRC']:
9         numobj = len(sources)    
10         maxobj = 30      
11
12         numlibs = numobj / maxobj        
13         if (numobj % maxobj):    
14                 numlibs = numlibs + 1    
15         subsources = []          
16          
17         if (env['OURPLATFORM'] == 'win32-mingw'):        
18                 for i in range(numlibs - 1):     
19                         subsources.append(sources[i*maxobj:(i+1)*maxobj])        
20                 subsources.append(sources[(numlibs-1)*maxobj:])
21
22 incs = ' #/intern/guardedalloc #/intern/memutil'
23 incs += ' ../blenlib ../makesdna ../blenkernel'
24 incs += ' ../include #/intern/bmfont ../imbuf ../render/extern/include'
25 incs += ' #/intern/bsp/extern ../radiosity/extern/include'
26 incs += ' #/intern/decimation/extern ../blenloader'
27 incs += ' ../../kernel/gen_system #/intern/SoundSystem ../readstreamglue ../nodes'
28 incs += ' #/intern/elbeem/extern'
29 incs += ' #/intern/ghost #/intern/opennl/extern'
30 incs += ' ../gpu #extern/glew/include'
31
32 incs += ' ' + env['BF_OPENGL_INC']
33
34 defs = []
35
36 if env['WITH_BF_PYTHON']:
37     incs += ' ../python ' + env['BF_PYTHON_INC']
38 else:
39     defs.append('DISABLE_PYTHON')
40
41
42 if env['BF_TWEAK_MODE']:
43     defs.append('TWEAK_MODE')
44
45 if not env['WITH_BF_YAFRAY']:
46     defs.append('DISABLE_YAFRAY')
47
48 if env['WITH_BF_INTERNATIONAL']:
49     incs += ' ../ftfont'
50     defs.append('INTERNATIONAL')
51     defs.append('FTGL_STATIC_LIBRARY')
52
53 if env['WITH_BF_OPENEXR']:
54     defs.append('WITH_OPENEXR')
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_QUICKTIME']:
63     incs += ' ' + env['BF_QUICKTIME_INC']
64     defs.append('WITH_QUICKTIME')
65
66 if env['WITH_BF_ICONV']:
67     incs += ' ../quicktime'
68     incs += ' ' + env['BF_ICONV_INC']
69     defs.append('WITH_ICONV')
70
71 if env['WITH_BF_GAMEENGINE']:
72         defs.append('GAMEBLENDER=1')
73
74 if env['WITH_BF_FFMPEG']:
75     defs.append('WITH_FFMPEG')
76     incs += ' ' + env['BF_FFMPEG_INC']
77
78 if env['WITH_BF_OGG']:
79     defs.append('WITH_OGG')
80
81 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross'):
82     incs += ' ' + env['BF_PTHREADS_INC']
83
84 if env['WITH_BF_VERSE']:
85     defs.append('WITH_VERSE')
86     incs += ' ' + env['BF_VERSE_INCLUDE']
87
88 # TODO buildinfo
89 if env['BF_BUILDINFO']:
90     defs.append('NAN_BUILDINFO')
91
92 if env['BF_NO_ELBEEM']:
93     defs.append('DISABLE_ELBEEM')
94
95 if env['WITH_BF_SDL']:
96     incs += ' ' + env['BF_SDL_INC']
97 else:
98     defs.append('DISABLE_SDL')
99
100 if env['WITH_BF_BULLET']:
101     defs.append('WITH_BULLET')
102
103 if env['BF_SPLIT_SRC'] and (env['OURPLATFORM'] == 'win32-mingw'):        
104         for i in range(numlibs):         
105                 env.BlenderLib ( libname = 'src%d' % (i), sources = subsources[i], includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] )      
106 else:
107         env.BlenderLib ( libname = 'src', sources = sources, includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] )