* integrate bFTGL with Scons
[blender.git] / extern / bFTGL / SConscript
1 #!/usr/bin/python
2 import sys
3 import os
4
5 ftgl_env = Environment(ENV=os.environ)
6
7 # Import the C flags set in the SConstruct file
8 Import ('cflags')
9 Import ('defines')
10 Import ('user_options_dict')
11
12 if sys.platform=='linux2' or sys.platform=='linux-i386':
13         ftgl_env.Append (CCFLAGS = ['-O2', '-ansi'])
14 elif sys.platform=='win32':
15         ftgl_env.Append (CCFLAGS = ['/O2'])
16 elif sys.platform=='sunos':
17         ftgl_env.Append (CCFLAGS = ['Xc', '-v', '-fast'])
18 elif sys.platform=='darwin':
19         ftgl_env.Append (CCFLAGS = ['-O2', '-pipe', '-fPIC', '-funsigned-char', '-ffast-math', '-mpowerpc' , '-mtune=G4'])
20 else:
21         ftgl_env.Append (CCFLAGS = cflags)
22
23 ftgl_env.Append (CPPDEFINES = defines)
24 ftgl_env.Append (CPPPATH = ['include',
25                              'src'])
26
27 ftgl_env.Append (CPPPATH = user_options_dict['FREETYPE_INCLUDE'])
28
29 source_files = [
30                 'src/FTBitmapGlyph.cpp',
31                 'src/FTCharmap.cpp',
32                 'src/FTContour.cpp',
33                 'src/FTExtrdGlyph.cpp',
34                 'src/FTFace.cpp',
35                 'src/FTFont.cpp',
36                 'src/FTGLBitmapFont.cpp',
37                 'src/FTGLExtrdFont.cpp',
38                 'src/FTGLOutlineFont.cpp',
39                 'src/FTGLPixmapFont.cpp',
40                 'src/FTGLPolygonFont.cpp',
41                 'src/FTGLTextureFont.cpp',
42                 'src/FTGlyph.cpp',
43                 'src/FTGlyphContainer.cpp',
44                 'src/FTLibrary.cpp',
45                 'src/FTOutlineGlyph.cpp',
46                 'src/FTPixmapGlyph.cpp',
47                 'src/FTPoint.cpp',
48                 'src/FTPolyGlyph.cpp',
49                 'src/FTSize.cpp',
50                 'src/FTTextureGlyph.cpp',
51                 'src/FTVectoriser.cpp']
52
53 ftgl_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/extern_ftgl', source=source_files)