5365908c130b9dfede32a60d6cb1a872f6f3d93d
[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'] == 1:
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 ../python'
27 incs += ' ../../kernel/gen_system #/intern/SoundSystem ../readstreamglue ../nodes'
28 incs += ' ../quicktime #/intern/elbeem/extern'
29 incs += ' #/intern/ghost #/intern/opennl/extern'
30 incs += ' ../gpu #extern/glew/include'
31
32
33 incs += ' ' + env['BF_PYTHON_INC']
34 incs += ' ' + env['BF_SDL_INC']
35 incs += ' ' + env['BF_OPENGL_INC']
36
37 defs = []
38
39 if env['BF_TWEAK_MODE'] == 1:
40     defs.append('TWEAK_MODE')
41
42 if env['WITH_BF_YAFRAY'] == 0:
43     defs.append('DISABLE_YAFRAY')
44
45 if env['WITH_BF_INTERNATIONAL'] == 1:
46     incs += ' ../ftfont'
47     defs.append('INTERNATIONAL')
48     defs.append('FTGL_STATIC_LIBRARY')
49
50 if env['WITH_BF_OPENEXR'] == 1:
51     defs.append('WITH_OPENEXR')
52
53 if env['WITH_BF_DDS'] == 1:
54     defs.append('WITH_DDS')
55
56 if env['WITH_BF_QUICKTIME']==1:
57     incs += ' ' + env['BF_QUICKTIME_INC']
58     defs.append('WITH_QUICKTIME')
59
60 if env['WITH_BF_ICONV'] == 1:
61     incs += ' ' + env['BF_ICONV_INC']
62     defs.append('WITH_ICONV')
63
64 if env['WITH_BF_FFMPEG'] == 1:
65     defs.append('WITH_FFMPEG')
66     incs += ' ' + env['BF_FFMPEG_INC']
67
68 if env['WITH_BF_OGG'] == 1:
69     defs.append('WITH_OGG')
70
71 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw'):
72     incs += ' ' + env['BF_PTHREADS_INC']
73
74 if env['WITH_BF_VERSE']:
75     defs.append('WITH_VERSE')
76     incs += ' ' + env['BF_VERSE_INCLUDE']
77
78 # TODO buildinfo
79 if env['BF_BUILDINFO'] == 1:
80     defs.append('NAN_BUILDINFO')
81
82 if env['BF_NO_ELBEEM'] == 1:
83     defs.append('DISABLE_ELBEEM')
84
85 if env['WITH_BF_SDL'] == 0:
86     defs.append('DISABLE_SDL')
87
88 if (env['BF_SPLIT_SRC'] == 1) and (env['OURPLATFORM'] == 'win32-mingw'):         
89         for i in range(numlibs):         
90                 env.BlenderLib ( libname = 'src%d' % (i), sources = subsources[i], includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] )      
91 else:
92         env.BlenderLib ( libname = 'src', sources = sources, includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] )