Scons files for Boolop
[blender.git] / tools / scons / bs / bs_libs.py
1 # Blender library functions
2
3 import sys
4 import os
5 import string
6 import SCons
7
8 import bs_globals
9
10 def common_libs(env):
11         """
12         Append to env all libraries that are common to Blender and Blenderplayer
13         """
14         env.Append (LIBS=[
15                 'blender_readblenfile',
16                 'blender_img',
17                 'blender_bop',
18                 'blender_blenkernel',
19                 'blender_blenloader',
20                 'blender_blenpluginapi',
21                 'blender_imbuf',
22                 'blender_avi',
23                 'blender_blenlib',
24                 'blender_makesdna',
25                 'blender_kernel',
26                 'blender_GHOST',
27                 'blender_STR',
28                 'blender_guardedalloc',
29                 'blender_CTR',
30                 'blender_MEM',
31                 'blender_MT',
32                 'blender_BMF',
33                 'soundsystem'])
34         if bs_globals.user_options_dict['USE_QUICKTIME'] == 1:
35                 env.Append (LIBS=['blender_quicktime'])
36
37 def international_libs(env):
38         """
39         Append international font support libraries
40         """
41         if bs_globals.user_options_dict['USE_INTERNATIONAL'] == 1:
42                 env.Append (LIBS=bs_globals.user_options_dict['FREETYPE_LIBRARY'])
43                 env.Append (LIBPATH=bs_globals.user_options_dict['FREETYPE_LIBPATH'])
44                 env.Append (LIBS=['blender_FTF'])
45                 if sys.platform=='darwin':
46                         env.Append (LIBS=bs_globals.user_options_dict['FTGL_LIBRARY'])
47                         env.Append (LIBPATH=bs_globals.user_options_dict['FTGL_LIBPATH'])
48                 else:
49                         env.Append (LIBS=['extern_ftgl'])
50                 env.Append (LIBS=bs_globals.user_options_dict['FREETYPE_LIBRARY'])
51
52 def blender_libs(env):
53         """
54         Blender only libs (not in player)
55         """
56         env.Append( LIBS=['blender_creator',
57                 'blender_blendersrc',
58                 'blender_render',
59                 'blender_yafray',
60                 'blender_renderconverter',
61                 'blender_radiosity',
62                 'blender_BSP',
63                 'blender_blenkernel',
64                 'blender_LOD',
65                 'blender_IK',
66                 'blender_ONL',
67                 'blender_elbeem' ])
68
69 def ketsji_libs(env):
70         """
71         Game Engine libs
72         """
73         if bs_globals.user_options_dict['BUILD_GAMEENGINE'] == 1:
74                 env.Append (LIBS=['KX_blenderhook',
75                                 'KX_converter',
76                                 'PHY_Dummy',
77                                 'PHY_Bullet',
78                                 'PHY_Physics',
79                                 'extern_bullet',
80                                 'KX_ketsji',
81                                 'SCA_GameLogic',
82                                 'RAS_rasterizer',
83                                 'RAS_OpenGLRasterizer',
84                                 'blender_expressions',
85                                 'SG_SceneGraph',
86                                 'blender_MT',
87                                 'KX_blenderhook',
88                                 'KX_network',
89                                 'blender_kernel',
90                                 'NG_network',
91                                 'NG_loopbacknetwork'])
92                 if bs_globals.user_options_dict['USE_PHYSICS'] == 'solid':
93                         env.Append (LIBS=['PHY_Sumo', 'PHY_Physics', 'blender_MT', 'extern_solid', 'extern_qhull'])
94                 elif bs_globals.user_options_dict['USE_PHYSICS'] == 'ode':
95                         env.Append (LIBS=['PHY_Ode',
96                                         'PHY_Physics'])
97                         env.Append (LIBS=bs_globals.user_options_dict['ODE_LIBRARY'])
98                         env.Append (LIBPATH=bs_globals.user_options_dict['ODE_LIBPATH'])
99
100 def player_libs(env):
101         """
102         Player libraries
103         """
104         env.Append (LIBS=['GPG_ghost',
105                         'GPC_common'])
106
107 def player_libs2(env):
108         """
109         Link order shenannigans: these libs are added after common_libs
110         """
111         env.Append (LIBS=['blender_blenkernel_blc',
112                                           'blender_LOD',                                  
113                                           'soundsystem'])
114
115 def winblenderres(env):
116         """
117         build the windows icon resource file
118         """
119         if sys.platform == 'win32':
120                 env.RES(['source/icons/winblender.rc'])
121
122 def system_libs(env):
123         """
124         System libraries: Python, SDL, PNG, JPEG, Gettext, OpenAL, Carbon
125         """
126         env.Append (LIBS=['blender_python'])
127         env.Append (LIBS=bs_globals.user_options_dict['PYTHON_LIBRARY'])
128         env.Append (LIBPATH=bs_globals.user_options_dict['PYTHON_LIBPATH'])
129         env.Append (LINKFLAGS=bs_globals.user_options_dict['PYTHON_LINKFLAGS'])
130         env.Append (LIBS=bs_globals.user_options_dict['SDL_LIBRARY'])
131         env.Append (LIBPATH=bs_globals.user_options_dict['SDL_LIBPATH'])
132         env.Append (LIBS=bs_globals.user_options_dict['PNG_LIBRARY'])
133         env.Append (LIBPATH=bs_globals.user_options_dict['PNG_LIBPATH'])
134         env.Append (LIBS=bs_globals.user_options_dict['JPEG_LIBRARY'])
135         env.Append (LIBPATH=bs_globals.user_options_dict['JPEG_LIBPATH'])
136         env.Append (LIBS=bs_globals.user_options_dict['GETTEXT_LIBRARY'])
137         env.Append (LIBPATH=bs_globals.user_options_dict['GETTEXT_LIBPATH'])
138         env.Append (LIBS=bs_globals.user_options_dict['Z_LIBRARY'])
139         env.Append (LIBPATH=bs_globals.user_options_dict['Z_LIBPATH'])
140         if bs_globals.user_options_dict['USE_OPENAL'] == 1:
141                 env.Append (LIBS=bs_globals.user_options_dict['OPENAL_LIBRARY'])
142                 env.Append (LIBPATH=bs_globals.user_options_dict['OPENAL_LIBPATH'])
143         env.Append (LIBS=bs_globals.user_options_dict['PLATFORM_LIBS'])
144         env.Append (LIBPATH=bs_globals.user_options_dict['PLATFORM_LIBPATH'])
145         if sys.platform == 'darwin':
146                 env.Append (LINKFLAGS='-framework')
147                 env.Append (LINKFLAGS='Carbon')
148                 env.Append (LINKFLAGS='-framework')
149                 env.Append (LINKFLAGS='AGL')
150                 env.Append (LINKFLAGS='-framework')
151                 env.Append (LINKFLAGS='AudioUnit')
152                 env.Append (LINKFLAGS='-framework')
153                 env.Append (LINKFLAGS='AudioToolbox')
154                 env.Append (LINKFLAGS='-framework')
155                 env.Append (LINKFLAGS='CoreAudio')
156                 if bs_globals.user_options_dict['USE_QUICKTIME'] == 1:
157                         env.Append (LINKFLAGS='-framework')
158                         env.Append (LINKFLAGS='QuickTime')
159         else:
160                 env.Append (LINKFLAGS=bs_globals.user_options_dict['PLATFORM_LINKFLAGS'])
161         env.BuildDir (bs_globals.root_build_dir, '.', duplicate=0)
162
163