ae3763d6e45690385315c58484d0d86855d72290
[blender.git] / extern / bullet / SConscript
1 #!/usr/bin/python
2 import sys
3 import os
4
5 bullet_env = Environment(ENV = os.environ)
6
7 # Import the C flags set in the SConstruct file
8 Import ('cflags')
9 #Import ('cxxflags')
10 #Import ('defines')
11 Import ('user_options_dict')
12 #defines = ['QHULL', '_LIB']
13 defines = ['USE_DOUBLES','QHULL', '_LIB']
14 #cflags = []
15 cxxflags = []
16
17 if sys.platform=='win32':
18         defines += ['WIN32','NDEBUG', '_WINDOWS', '_LIB']
19         #cflags += ['/MT', '/W3', '/GX', '/O2', '/Op']
20         cflags += ['/MT', '/W3', '/GX', '/Og', '/Ot', '/Ob1', '/Op', '/G6']
21 elif sys.platform=='linux2' or sys.platform=='linux-i386' or sys.platform=='freebsd4' or sys.platform=='freebsd5':
22         defines += ['NDEBUG']
23         cflags += ['-O2']
24 elif sys.platform=='darwin' :
25         defines += ['NDEBUG']
26         cflags += ['-O2','-pipe', '-fPIC', '-funsigned-char', '-ffast-math', '-mpowerpc' , '-mtune=G4']
27
28 else:
29     print "################################################"
30     print 
31     print "Check if bullet builds on your platform correctly"
32     print "Add your platform specific defines"
33     print "and cflags / cxxflags to the"
34     print "extern/bullet/SConscript file"
35
36 bullet_env.Append (CCFLAGS = cflags)
37 bullet_env.Append (CPPFLAGS = cxxflags)
38
39 bullet_env.Append (CPPDEFINES = defines)
40
41 bullet_sources = ['Bullet/BroadphaseCollision/BroadphaseProxy.cpp',
42                                 'Bullet/BroadphaseCollision/CollisionAlgorithm.cpp',
43                                 'Bullet/BroadphaseCollision/CollisionDispatcher.cpp',
44                                 'Bullet/BroadphaseCollision/SimpleBroadphase.cpp',
45                                 
46                                 'Bullet/CollisionShapes/BoxShape.cpp',
47                                 'Bullet/CollisionShapes/CollisionShape.cpp',
48                                 'Bullet/CollisionShapes/ConeShape.cpp',
49                                 'Bullet/CollisionShapes/ConvexHullShape.cpp',
50                                 'Bullet/CollisionShapes/ConvexShape.cpp',
51                                 'Bullet/CollisionShapes/CylinderShape.cpp',
52                                 'Bullet/CollisionShapes/MinkowskiSumShape.cpp',
53                                 'Bullet/CollisionShapes/MultiSphereShape.cpp',
54                                 'Bullet/CollisionShapes/PolyhedralConvexShape.cpp',
55                                 'Bullet/CollisionShapes/Simplex1to4Shape.cpp',
56                                 'Bullet/CollisionShapes/SphereShape.cpp',
57                                 'Bullet/CollisionShapes/StridingMeshInterface.cpp',
58                                 'Bullet/CollisionShapes/TriangleMesh.cpp',
59                                 'Bullet/CollisionShapes/TriangleMeshShape.cpp',
60                                 
61                                 'Bullet/NarrowPhaseCollision/BU_AlgebraicPolynomialSolver.cpp',
62                                 'Bullet/NarrowPhaseCollision/BU_Collidable.cpp',
63                                 'Bullet/NarrowPhaseCollision/BU_CollisionPair.cpp',
64                                 'Bullet/NarrowPhaseCollision/BU_EdgeEdge.cpp',
65                                 'Bullet/NarrowPhaseCollision/BU_Screwing.cpp',
66                                 'Bullet/NarrowPhaseCollision/BU_VertexPoly.cpp',
67                                 'Bullet/NarrowPhaseCollision/ContinuousConvexCollision.cpp',
68                                 'Bullet/NarrowPhaseCollision/ConvexCast.cpp',
69                                 'Bullet/NarrowPhaseCollision/GjkConvexCast.cpp',
70                                 'Bullet/NarrowPhaseCollision/GjkPairDetector.cpp',
71                                 'Bullet/NarrowPhaseCollision/MinkowskiPenetrationDepthSolver.cpp',
72                                 'Bullet/NarrowPhaseCollision/PersistentManifold.cpp',
73                                 'Bullet/NarrowPhaseCollision/RaycastCallback.cpp',
74                                 'Bullet/NarrowPhaseCollision/SubSimplexConvexCast.cpp',
75                                 'Bullet/NarrowPhaseCollision/VoronoiSimplexSolver.cpp',
76                                 
77                                 'BulletDynamics/CollisionDispatch/ConvexConcaveCollisionAlgorithm.cpp',
78                                 'BulletDynamics/CollisionDispatch/ConvexConvexAlgorithm.cpp',
79                                 'BulletDynamics/CollisionDispatch/EmptyCollisionAlgorithm.cpp',
80                                 'BulletDynamics/CollisionDispatch/ManifoldResult.cpp',
81                                 'BulletDynamics/CollisionDispatch/ToiContactDispatcher.cpp',
82                                 'BulletDynamics/CollisionDispatch/UnionFind.cpp',
83                                 
84                                 'BulletDynamics/ConstraintSolver/ContactConstraint.cpp',
85                                 'BulletDynamics/ConstraintSolver/OdeConstraintSolver.cpp',
86                                 #'BulletDynamics/ConstraintSolver/OdeConstraintSolver2.cpp',
87                                 'BulletDynamics/ConstraintSolver/Point2PointConstraint.cpp',
88                                 'BulletDynamics/ConstraintSolver/SimpleConstraintSolver.cpp',
89                                 'BulletDynamics/ConstraintSolver/Solve2LinearConstraint.cpp',
90                                 'BulletDynamics/ConstraintSolver/SorLcp.cpp',
91                                 
92                                 'BulletDynamics/Dynamics/BU_Joint.cpp',
93                                 'BulletDynamics/Dynamics/ContactJoint.cpp',
94                                 'BulletDynamics/Dynamics/RigidBody.cpp',
95                                         ]
96
97 bullet_env.Append (CPPPATH = ['.',
98                              'Bullet',
99                              'BulletDynamics',
100                              'LinearMath'
101                              ])
102 source_files = bullet_sources 
103
104 bullet_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/extern_bullet', source=bullet_sources)