SCsub 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. #!/usr/bin/env python
  2. Import("env")
  3. Import("env_modules")
  4. env_bullet = env_modules.Clone()
  5. # Thirdparty source files
  6. thirdparty_obj = []
  7. if env["builtin_bullet"]:
  8. # Build only "Bullet2" API (not "Bullet3" folders).
  9. # Sync file list with relevant upstream CMakeLists.txt for each folder.
  10. thirdparty_dir = "#thirdparty/bullet/"
  11. bullet2_src = [
  12. # BulletCollision
  13. "BulletCollision/BroadphaseCollision/btAxisSweep3.cpp",
  14. "BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp",
  15. "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp",
  16. "BulletCollision/BroadphaseCollision/btDbvt.cpp",
  17. "BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp",
  18. "BulletCollision/BroadphaseCollision/btDispatcher.cpp",
  19. "BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp",
  20. "BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp",
  21. "BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp",
  22. "BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp",
  23. "BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp",
  24. "BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp",
  25. "BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp",
  26. "BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp",
  27. "BulletCollision/CollisionDispatch/btCollisionDispatcherMt.cpp",
  28. "BulletCollision/CollisionDispatch/btCollisionObject.cpp",
  29. "BulletCollision/CollisionDispatch/btCollisionWorld.cpp",
  30. "BulletCollision/CollisionDispatch/btCollisionWorldImporter.cpp",
  31. "BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp",
  32. "BulletCollision/CollisionDispatch/btCompoundCompoundCollisionAlgorithm.cpp",
  33. "BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp",
  34. "BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp",
  35. "BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp",
  36. "BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp",
  37. "BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp",
  38. "BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp",
  39. "BulletCollision/CollisionDispatch/btGhostObject.cpp",
  40. "BulletCollision/CollisionDispatch/btHashedSimplePairCache.cpp",
  41. "BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp",
  42. "BulletCollision/CollisionDispatch/btManifoldResult.cpp",
  43. "BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp",
  44. "BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp",
  45. "BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp",
  46. "BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp",
  47. "BulletCollision/CollisionDispatch/btUnionFind.cpp",
  48. "BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp",
  49. "BulletCollision/CollisionShapes/btBoxShape.cpp",
  50. "BulletCollision/CollisionShapes/btBox2dShape.cpp",
  51. "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp",
  52. "BulletCollision/CollisionShapes/btCapsuleShape.cpp",
  53. "BulletCollision/CollisionShapes/btCollisionShape.cpp",
  54. "BulletCollision/CollisionShapes/btCompoundShape.cpp",
  55. "BulletCollision/CollisionShapes/btConcaveShape.cpp",
  56. "BulletCollision/CollisionShapes/btConeShape.cpp",
  57. "BulletCollision/CollisionShapes/btConvexHullShape.cpp",
  58. "BulletCollision/CollisionShapes/btConvexInternalShape.cpp",
  59. "BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp",
  60. "BulletCollision/CollisionShapes/btConvexPolyhedron.cpp",
  61. "BulletCollision/CollisionShapes/btConvexShape.cpp",
  62. "BulletCollision/CollisionShapes/btConvex2dShape.cpp",
  63. "BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp",
  64. "BulletCollision/CollisionShapes/btCylinderShape.cpp",
  65. "BulletCollision/CollisionShapes/btEmptyShape.cpp",
  66. "BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp",
  67. "BulletCollision/CollisionShapes/btMiniSDF.cpp",
  68. "BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp",
  69. "BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp",
  70. "BulletCollision/CollisionShapes/btMultiSphereShape.cpp",
  71. "BulletCollision/CollisionShapes/btOptimizedBvh.cpp",
  72. "BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp",
  73. "BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp",
  74. "BulletCollision/CollisionShapes/btSdfCollisionShape.cpp",
  75. "BulletCollision/CollisionShapes/btShapeHull.cpp",
  76. "BulletCollision/CollisionShapes/btSphereShape.cpp",
  77. "BulletCollision/CollisionShapes/btStaticPlaneShape.cpp",
  78. "BulletCollision/CollisionShapes/btStridingMeshInterface.cpp",
  79. "BulletCollision/CollisionShapes/btTetrahedronShape.cpp",
  80. "BulletCollision/CollisionShapes/btTriangleBuffer.cpp",
  81. "BulletCollision/CollisionShapes/btTriangleCallback.cpp",
  82. "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp",
  83. "BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp",
  84. "BulletCollision/CollisionShapes/btTriangleMesh.cpp",
  85. "BulletCollision/CollisionShapes/btTriangleMeshShape.cpp",
  86. "BulletCollision/CollisionShapes/btUniformScalingShape.cpp",
  87. "BulletCollision/Gimpact/btContactProcessing.cpp",
  88. "BulletCollision/Gimpact/btGenericPoolAllocator.cpp",
  89. "BulletCollision/Gimpact/btGImpactBvh.cpp",
  90. "BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp",
  91. "BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp",
  92. "BulletCollision/Gimpact/btGImpactShape.cpp",
  93. "BulletCollision/Gimpact/btTriangleShapeEx.cpp",
  94. "BulletCollision/Gimpact/gim_box_set.cpp",
  95. "BulletCollision/Gimpact/gim_contact.cpp",
  96. "BulletCollision/Gimpact/gim_memory.cpp",
  97. "BulletCollision/Gimpact/gim_tri_collision.cpp",
  98. "BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp",
  99. "BulletCollision/NarrowPhaseCollision/btConvexCast.cpp",
  100. "BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp",
  101. "BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp",
  102. "BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp",
  103. "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp",
  104. "BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp",
  105. "BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp",
  106. "BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp",
  107. "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp",
  108. "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp",
  109. "BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp",
  110. # BulletDynamics
  111. "BulletDynamics/Character/btKinematicCharacterController.cpp",
  112. "BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp",
  113. "BulletDynamics/ConstraintSolver/btContactConstraint.cpp",
  114. "BulletDynamics/ConstraintSolver/btFixedConstraint.cpp",
  115. "BulletDynamics/ConstraintSolver/btGearConstraint.cpp",
  116. "BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp",
  117. "BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp",
  118. "BulletDynamics/ConstraintSolver/btGeneric6DofSpring2Constraint.cpp",
  119. "BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp",
  120. "BulletDynamics/ConstraintSolver/btHingeConstraint.cpp",
  121. "BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp",
  122. "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp",
  123. "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolverMt.cpp",
  124. "BulletDynamics/ConstraintSolver/btBatchedConstraints.cpp",
  125. "BulletDynamics/ConstraintSolver/btNNCGConstraintSolver.cpp",
  126. "BulletDynamics/ConstraintSolver/btSliderConstraint.cpp",
  127. "BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp",
  128. "BulletDynamics/ConstraintSolver/btTypedConstraint.cpp",
  129. "BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp",
  130. "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp",
  131. "BulletDynamics/Dynamics/btDiscreteDynamicsWorldMt.cpp",
  132. "BulletDynamics/Dynamics/btSimulationIslandManagerMt.cpp",
  133. "BulletDynamics/Dynamics/btRigidBody.cpp",
  134. "BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp",
  135. # "BulletDynamics/Dynamics/Bullet-C-API.cpp",
  136. "BulletDynamics/Vehicle/btRaycastVehicle.cpp",
  137. "BulletDynamics/Vehicle/btWheelInfo.cpp",
  138. "BulletDynamics/Featherstone/btMultiBody.cpp",
  139. "BulletDynamics/Featherstone/btMultiBodyConstraint.cpp",
  140. "BulletDynamics/Featherstone/btMultiBodyConstraintSolver.cpp",
  141. "BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.cpp",
  142. "BulletDynamics/Featherstone/btMultiBodyFixedConstraint.cpp",
  143. "BulletDynamics/Featherstone/btMultiBodyGearConstraint.cpp",
  144. "BulletDynamics/Featherstone/btMultiBodyJointLimitConstraint.cpp",
  145. "BulletDynamics/Featherstone/btMultiBodyJointMotor.cpp",
  146. "BulletDynamics/Featherstone/btMultiBodyMLCPConstraintSolver.cpp",
  147. "BulletDynamics/Featherstone/btMultiBodyPoint2Point.cpp",
  148. "BulletDynamics/Featherstone/btMultiBodySliderConstraint.cpp",
  149. "BulletDynamics/Featherstone/btMultiBodySphericalJointLimit.cpp",
  150. "BulletDynamics/Featherstone/btMultiBodySphericalJointMotor.cpp",
  151. "BulletDynamics/MLCPSolvers/btDantzigLCP.cpp",
  152. "BulletDynamics/MLCPSolvers/btMLCPSolver.cpp",
  153. "BulletDynamics/MLCPSolvers/btLemkeAlgorithm.cpp",
  154. # BulletInverseDynamics
  155. # -- Unused for now so not included.
  156. # BulletSoftBody
  157. "BulletSoftBody/btSoftBody.cpp",
  158. "BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp",
  159. "BulletSoftBody/btSoftBodyHelpers.cpp",
  160. "BulletSoftBody/btSoftBodyRigidBodyCollisionConfiguration.cpp",
  161. "BulletSoftBody/btSoftRigidCollisionAlgorithm.cpp",
  162. "BulletSoftBody/btSoftRigidDynamicsWorld.cpp",
  163. "BulletSoftBody/btSoftMultiBodyDynamicsWorld.cpp",
  164. "BulletSoftBody/btSoftSoftCollisionAlgorithm.cpp",
  165. "BulletSoftBody/btDefaultSoftBodySolver.cpp",
  166. "BulletSoftBody/btDeformableBackwardEulerObjective.cpp",
  167. "BulletSoftBody/btDeformableBodySolver.cpp",
  168. "BulletSoftBody/btDeformableMultiBodyConstraintSolver.cpp",
  169. "BulletSoftBody/btDeformableContactProjection.cpp",
  170. "BulletSoftBody/btDeformableMultiBodyDynamicsWorld.cpp",
  171. "BulletSoftBody/btDeformableContactConstraint.cpp",
  172. "BulletSoftBody/BulletReducedDeformableBody/btReducedDeformableBody.cpp",
  173. "BulletSoftBody/BulletReducedDeformableBody/btReducedDeformableBodyHelpers.cpp",
  174. "BulletSoftBody/BulletReducedDeformableBody/btReducedDeformableBodySolver.cpp",
  175. "BulletSoftBody/BulletReducedDeformableBody/btReducedDeformableContactConstraint.cpp",
  176. "BulletSoftBody/poly34.cpp",
  177. # LinearMath
  178. "LinearMath/btAlignedAllocator.cpp",
  179. "LinearMath/btConvexHull.cpp",
  180. "LinearMath/btConvexHullComputer.cpp",
  181. "LinearMath/btGeometryUtil.cpp",
  182. "LinearMath/btPolarDecomposition.cpp",
  183. "LinearMath/btQuickprof.cpp",
  184. "LinearMath/btReducedVector.cpp",
  185. "LinearMath/btSerializer.cpp",
  186. "LinearMath/btSerializer64.cpp",
  187. "LinearMath/btThreads.cpp",
  188. "LinearMath/btVector3.cpp",
  189. "LinearMath/TaskScheduler/btTaskScheduler.cpp",
  190. "LinearMath/TaskScheduler/btThreadSupportPosix.cpp",
  191. "LinearMath/TaskScheduler/btThreadSupportWin32.cpp",
  192. ]
  193. thirdparty_sources = [thirdparty_dir + file for file in bullet2_src]
  194. env_bullet.Prepend(CPPPATH=[thirdparty_dir])
  195. env_bullet.Append(CPPDEFINES=["BT_USE_OLD_DAMPING_METHOD", "BT_THREADSAFE"])
  196. env_thirdparty = env_bullet.Clone()
  197. env_thirdparty.disable_warnings()
  198. env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
  199. env.modules_sources += thirdparty_obj
  200. # Godot source files
  201. module_obj = []
  202. env_bullet.add_source_files(module_obj, "*.cpp")
  203. env.modules_sources += module_obj
  204. # Needed to force rebuilding the module files when the thirdparty library is updated.
  205. env.Depends(module_obj, thirdparty_obj)