* commit r17900 by Genscher was wrong.
[blender-staging.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_DDS']:
57     defs.append('WITH_DDS')
58
59 if env['WITH_BF_QUICKTIME']:
60     incs += ' ' + env['BF_QUICKTIME_INC']
61     defs.append('WITH_QUICKTIME')
62
63 if env['WITH_BF_ICONV']:
64     incs += ' ../quicktime'
65     incs += ' ' + env['BF_ICONV_INC']
66     defs.append('WITH_ICONV')
67
68 if env['WITH_BF_GAMEENGINE']:
69         defs.append('GAMEBLENDER=1')
70
71 if env['WITH_BF_FFMPEG']:
72     defs.append('WITH_FFMPEG')
73     incs += ' ' + env['BF_FFMPEG_INC']
74
75 if env['WITH_BF_OGG']:
76     defs.append('WITH_OGG')
77
78 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross'):
79     incs += ' ' + env['BF_PTHREADS_INC']
80
81 if env['WITH_BF_VERSE']:
82     defs.append('WITH_VERSE')
83     incs += ' ' + env['BF_VERSE_INCLUDE']
84
85 # TODO buildinfo
86 if env['BF_BUILDINFO']:
87     defs.append('NAN_BUILDINFO')
88
89 if env['BF_NO_ELBEEM']:
90     defs.append('DISABLE_ELBEEM')
91
92 if env['WITH_BF_SDL']:
93     incs += ' ' + env['BF_SDL_INC']
94 else:
95     defs.append('DISABLE_SDL')
96
97 if env['WITH_BF_BULLET']:
98     defs.append('WITH_BULLET')
99
100 if env['BF_SPLIT_SRC'] and (env['OURPLATFORM'] == 'win32-mingw'):        
101         for i in range(numlibs):         
102                 env.BlenderLib ( libname = 'src%d' % (i), sources = subsources[i], includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] )      
103 else:
104         env.BlenderLib ( libname = 'src', sources = sources, includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] )