Fix building with scons
[blender.git] / extern / bullet2 / src / SConscript
1 #!/usr/bin/python
2 import sys
3 import os
4
5 Import('env')
6
7 defs = ''
8 cflags = []
9
10 if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
11     defs += ' WIN32 NDEBUG _WINDOWS'
12     #cflags += ['/MT', '/W3', '/GX', '/O2', '/Op']
13     cflags += ['/MT', '/W3', '/GX', '/Og', '/Ot', '/Ob1', '/Op', '/G6', '/O3', '/EHcs']
14 elif env['OURPLATFORM'] in ('win32-mingw', 'linuxcross', 'win64-mingw'):
15     defs += ' NDEBUG'
16     cflags += ['-O2']
17 elif env['OURPLATFORM'] in ('linux', 'freebsd4', 'freebsd5'):
18     defs += ' NDEBUG'
19     cflags += ['-O2']
20 elif sys.platform=='darwin':
21     defs += ' NDEBUG'
22     cflags += ['-O2','-pipe', '-fPIC', '-funsigned-char', '-ffast-math']
23
24 bullet2_src = env.Glob("LinearMath/*.cpp")
25 bullet2_src += env.Glob("BulletCollision/BroadphaseCollision/*.cpp")
26 bullet2_src += env.Glob("BulletCollision/CollisionDispatch/*.cpp")
27 bullet2_src += env.Glob("BulletCollision/Gimpact/*.cpp")
28 bullet2_src += env.Glob("BulletCollision/CollisionShapes/*.cpp")
29 bullet2_src += env.Glob("BulletCollision/NarrowPhaseCollision/*.cpp")
30 bullet2_src += env.Glob("BulletDynamics/Vehicle/*.cpp")
31 bullet2_src += env.Glob("BulletDynamics/ConstraintSolver/*.cpp")
32 bullet2_src += env.Glob("BulletDynamics/Dynamics/*.cpp")
33 bullet2_src += env.Glob("BulletDynamics/Character/*.cpp")
34 bullet2_src += env.Glob("BulletDynamics/Featherstone/*.cpp")
35 bullet2_src += env.Glob("BulletDynamics/MLCPSolvers/*.cpp")
36 bullet2_src += env.Glob("BulletSoftBody/*.cpp")
37
38 incs = '. BulletCollision BulletDynamics LinearMath BulletSoftBody'
39
40 if sys.platform=='darwin' and env['CC'][:-2].endswith('4.6'): # workaround for an gcc-4.6 compiler bug
41         env.BlenderLib ( libname = 'extern_bullet2', sources=bullet2_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[20,137], compileflags=cflags, cc_compilerchange='/usr/bin/gcc', cxx_compilerchange='/usr/bin/g++' )
42 else:
43         env.BlenderLib ( libname = 'extern_bullet2', sources=bullet2_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[20,137], compileflags=cflags )