dedb40485ef3278a50dde804174b0ed7da811966
[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_FFMPEG']:
69     defs.append('WITH_FFMPEG')
70     incs += ' ' + env['BF_FFMPEG_INC']
71
72 if env['WITH_BF_OGG']:
73     defs.append('WITH_OGG')
74
75 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross'):
76     incs += ' ' + env['BF_PTHREADS_INC']
77
78 if env['WITH_BF_VERSE']:
79     defs.append('WITH_VERSE')
80     incs += ' ' + env['BF_VERSE_INCLUDE']
81
82 # TODO buildinfo
83 if env['BF_BUILDINFO']:
84     defs.append('NAN_BUILDINFO')
85
86 if env['BF_NO_ELBEEM']:
87     defs.append('DISABLE_ELBEEM')
88
89 if env['WITH_BF_SDL']:
90     incs += ' ' + env['BF_SDL_INC']
91 else:
92     defs.append('DISABLE_SDL')
93
94 if env['WITH_BF_BULLET']:
95     defs.append('WITH_BULLET')
96
97 if env['BF_SPLIT_SRC'] and (env['OURPLATFORM'] == 'win32-mingw'):        
98         for i in range(numlibs):         
99                 env.BlenderLib ( libname = 'src%d' % (i), sources = subsources[i], includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] )      
100 else:
101         env.BlenderLib ( libname = 'src', sources = sources, includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] )