Building the game engine with Solid/Sumo is now optional for scons using WITH_BF_SOLID.
[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_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         if env['WITH_BF_SOLID']:
74                 defs.append('USE_SUMO_SOLID')
75         
76 if env['WITH_BF_FFMPEG']:
77     defs.append('WITH_FFMPEG')
78     incs += ' ' + env['BF_FFMPEG_INC']
79
80 if env['WITH_BF_OGG']:
81     defs.append('WITH_OGG')
82
83 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross'):
84     incs += ' ' + env['BF_PTHREADS_INC']
85
86 if env['WITH_BF_VERSE']:
87     defs.append('WITH_VERSE')
88     incs += ' ' + env['BF_VERSE_INCLUDE']
89
90 # TODO buildinfo
91 if env['BF_BUILDINFO']:
92     defs.append('NAN_BUILDINFO')
93
94 if env['BF_NO_ELBEEM']:
95     defs.append('DISABLE_ELBEEM')
96
97 if env['WITH_BF_SDL']:
98     incs += ' ' + env['BF_SDL_INC']
99 else:
100     defs.append('DISABLE_SDL')
101
102 if env['WITH_BF_BULLET']:
103     defs.append('WITH_BULLET')
104
105 if env['BF_SPLIT_SRC'] and (env['OURPLATFORM'] == 'win32-mingw'):        
106         for i in range(numlibs):         
107                 env.BlenderLib ( libname = 'src%d' % (i), sources = subsources[i], includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] )      
108 else:
109         env.BlenderLib ( libname = 'src', sources = sources, includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] )