|
| 1 | +#!/usr/bin/env python |
| 2 | + |
| 3 | +Import("env") |
| 4 | +Import("env_modules") |
| 5 | + |
| 6 | +env_jolt = env_modules.Clone() |
| 7 | + |
| 8 | +# Thirdparty source files |
| 9 | + |
| 10 | +thirdparty_dir = "#thirdparty/jolt_physics/" |
| 11 | +thirdparty_sources = [ |
| 12 | + "Jolt/RegisterTypes.cpp", |
| 13 | + "Jolt/AABBTree/AABBTreeBuilder.cpp", |
| 14 | + "Jolt/Core/Color.cpp", |
| 15 | + "Jolt/Core/Factory.cpp", |
| 16 | + "Jolt/Core/IssueReporting.cpp", |
| 17 | + "Jolt/Core/JobSystemSingleThreaded.cpp", |
| 18 | + "Jolt/Core/JobSystemThreadPool.cpp", |
| 19 | + "Jolt/Core/JobSystemWithBarrier.cpp", |
| 20 | + "Jolt/Core/LinearCurve.cpp", |
| 21 | + "Jolt/Core/Memory.cpp", |
| 22 | + "Jolt/Core/Profiler.cpp", |
| 23 | + "Jolt/Core/RTTI.cpp", |
| 24 | + "Jolt/Core/Semaphore.cpp", |
| 25 | + "Jolt/Core/StringTools.cpp", |
| 26 | + "Jolt/Core/TickCounter.cpp", |
| 27 | + "Jolt/Geometry/ConvexHullBuilder.cpp", |
| 28 | + "Jolt/Geometry/ConvexHullBuilder2D.cpp", |
| 29 | + "Jolt/Geometry/Indexify.cpp", |
| 30 | + "Jolt/Geometry/OrientedBox.cpp", |
| 31 | + "Jolt/Math/Vec3.cpp", |
| 32 | + "Jolt/ObjectStream/SerializableObject.cpp", |
| 33 | + "Jolt/Physics/DeterminismLog.cpp", |
| 34 | + "Jolt/Physics/IslandBuilder.cpp", |
| 35 | + "Jolt/Physics/LargeIslandSplitter.cpp", |
| 36 | + "Jolt/Physics/PhysicsScene.cpp", |
| 37 | + "Jolt/Physics/PhysicsSystem.cpp", |
| 38 | + "Jolt/Physics/PhysicsUpdateContext.cpp", |
| 39 | + "Jolt/Physics/StateRecorderImpl.cpp", |
| 40 | + "Jolt/Physics/Body/Body.cpp", |
| 41 | + "Jolt/Physics/Body/BodyCreationSettings.cpp", |
| 42 | + "Jolt/Physics/Body/BodyInterface.cpp", |
| 43 | + "Jolt/Physics/Body/BodyManager.cpp", |
| 44 | + "Jolt/Physics/Body/MassProperties.cpp", |
| 45 | + "Jolt/Physics/Body/MotionProperties.cpp", |
| 46 | + "Jolt/Physics/Character/Character.cpp", |
| 47 | + "Jolt/Physics/Character/CharacterBase.cpp", |
| 48 | + "Jolt/Physics/Character/CharacterVirtual.cpp", |
| 49 | + "Jolt/Physics/Collision/CastConvexVsTriangles.cpp", |
| 50 | + "Jolt/Physics/Collision/CastSphereVsTriangles.cpp", |
| 51 | + "Jolt/Physics/Collision/CollideConvexVsTriangles.cpp", |
| 52 | + "Jolt/Physics/Collision/CollideSphereVsTriangles.cpp", |
| 53 | + "Jolt/Physics/Collision/CollisionDispatch.cpp", |
| 54 | + "Jolt/Physics/Collision/CollisionGroup.cpp", |
| 55 | + "Jolt/Physics/Collision/EstimateCollisionResponse.cpp", |
| 56 | + "Jolt/Physics/Collision/GroupFilter.cpp", |
| 57 | + "Jolt/Physics/Collision/GroupFilterTable.cpp", |
| 58 | + "Jolt/Physics/Collision/ManifoldBetweenTwoFaces.cpp", |
| 59 | + "Jolt/Physics/Collision/NarrowPhaseQuery.cpp", |
| 60 | + "Jolt/Physics/Collision/NarrowPhaseStats.cpp", |
| 61 | + "Jolt/Physics/Collision/PhysicsMaterial.cpp", |
| 62 | + "Jolt/Physics/Collision/PhysicsMaterialSimple.cpp", |
| 63 | + "Jolt/Physics/Collision/TransformedShape.cpp", |
| 64 | + "Jolt/Physics/Collision/BroadPhase/BroadPhase.cpp", |
| 65 | + "Jolt/Physics/Collision/BroadPhase/BroadPhaseBruteForce.cpp", |
| 66 | + "Jolt/Physics/Collision/BroadPhase/BroadPhaseQuadTree.cpp", |
| 67 | + "Jolt/Physics/Collision/BroadPhase/QuadTree.cpp", |
| 68 | + "Jolt/Physics/Collision/Shape/BoxShape.cpp", |
| 69 | + "Jolt/Physics/Collision/Shape/CapsuleShape.cpp", |
| 70 | + "Jolt/Physics/Collision/Shape/CompoundShape.cpp", |
| 71 | + "Jolt/Physics/Collision/Shape/ConvexHullShape.cpp", |
| 72 | + "Jolt/Physics/Collision/Shape/ConvexShape.cpp", |
| 73 | + "Jolt/Physics/Collision/Shape/CylinderShape.cpp", |
| 74 | + "Jolt/Physics/Collision/Shape/DecoratedShape.cpp", |
| 75 | + "Jolt/Physics/Collision/Shape/EmptyShape.cpp", |
| 76 | + "Jolt/Physics/Collision/Shape/HeightFieldShape.cpp", |
| 77 | + "Jolt/Physics/Collision/Shape/MeshShape.cpp", |
| 78 | + "Jolt/Physics/Collision/Shape/MutableCompoundShape.cpp", |
| 79 | + "Jolt/Physics/Collision/Shape/OffsetCenterOfMassShape.cpp", |
| 80 | + "Jolt/Physics/Collision/Shape/PlaneShape.cpp", |
| 81 | + "Jolt/Physics/Collision/Shape/RotatedTranslatedShape.cpp", |
| 82 | + "Jolt/Physics/Collision/Shape/ScaledShape.cpp", |
| 83 | + "Jolt/Physics/Collision/Shape/Shape.cpp", |
| 84 | + "Jolt/Physics/Collision/Shape/SphereShape.cpp", |
| 85 | + "Jolt/Physics/Collision/Shape/StaticCompoundShape.cpp", |
| 86 | + "Jolt/Physics/Collision/Shape/TaperedCapsuleShape.cpp", |
| 87 | + "Jolt/Physics/Collision/Shape/TaperedCylinderShape.cpp", |
| 88 | + "Jolt/Physics/Collision/Shape/TriangleShape.cpp", |
| 89 | + "Jolt/Physics/Constraints/ConeConstraint.cpp", |
| 90 | + "Jolt/Physics/Constraints/Constraint.cpp", |
| 91 | + "Jolt/Physics/Constraints/ConstraintManager.cpp", |
| 92 | + "Jolt/Physics/Constraints/ContactConstraintManager.cpp", |
| 93 | + "Jolt/Physics/Constraints/DistanceConstraint.cpp", |
| 94 | + "Jolt/Physics/Constraints/FixedConstraint.cpp", |
| 95 | + "Jolt/Physics/Constraints/GearConstraint.cpp", |
| 96 | + "Jolt/Physics/Constraints/HingeConstraint.cpp", |
| 97 | + "Jolt/Physics/Constraints/MotorSettings.cpp", |
| 98 | + "Jolt/Physics/Constraints/PathConstraint.cpp", |
| 99 | + "Jolt/Physics/Constraints/PathConstraintPath.cpp", |
| 100 | + "Jolt/Physics/Constraints/PathConstraintPathHermite.cpp", |
| 101 | + "Jolt/Physics/Constraints/PointConstraint.cpp", |
| 102 | + "Jolt/Physics/Constraints/PulleyConstraint.cpp", |
| 103 | + "Jolt/Physics/Constraints/RackAndPinionConstraint.cpp", |
| 104 | + "Jolt/Physics/Constraints/SixDOFConstraint.cpp", |
| 105 | + "Jolt/Physics/Constraints/SliderConstraint.cpp", |
| 106 | + "Jolt/Physics/Constraints/SpringSettings.cpp", |
| 107 | + "Jolt/Physics/Constraints/SwingTwistConstraint.cpp", |
| 108 | + "Jolt/Physics/Constraints/TwoBodyConstraint.cpp", |
| 109 | + "Jolt/Physics/Ragdoll/Ragdoll.cpp", |
| 110 | + "Jolt/Physics/SoftBody/SoftBodyCreationSettings.cpp", |
| 111 | + "Jolt/Physics/SoftBody/SoftBodyMotionProperties.cpp", |
| 112 | + "Jolt/Physics/SoftBody/SoftBodyShape.cpp", |
| 113 | + "Jolt/Physics/SoftBody/SoftBodySharedSettings.cpp", |
| 114 | + "Jolt/Physics/Vehicle/MotorcycleController.cpp", |
| 115 | + "Jolt/Physics/Vehicle/TrackedVehicleController.cpp", |
| 116 | + "Jolt/Physics/Vehicle/VehicleAntiRollBar.cpp", |
| 117 | + "Jolt/Physics/Vehicle/VehicleCollisionTester.cpp", |
| 118 | + "Jolt/Physics/Vehicle/VehicleConstraint.cpp", |
| 119 | + "Jolt/Physics/Vehicle/VehicleController.cpp", |
| 120 | + "Jolt/Physics/Vehicle/VehicleDifferential.cpp", |
| 121 | + "Jolt/Physics/Vehicle/VehicleEngine.cpp", |
| 122 | + "Jolt/Physics/Vehicle/VehicleTrack.cpp", |
| 123 | + "Jolt/Physics/Vehicle/VehicleTransmission.cpp", |
| 124 | + "Jolt/Physics/Vehicle/Wheel.cpp", |
| 125 | + "Jolt/Physics/Vehicle/WheeledVehicleController.cpp", |
| 126 | + "Jolt/Renderer/DebugRenderer.cpp", |
| 127 | + "Jolt/Renderer/DebugRendererPlayback.cpp", |
| 128 | + "Jolt/Renderer/DebugRendererRecorder.cpp", |
| 129 | + "Jolt/Renderer/DebugRendererSimple.cpp", |
| 130 | + "Jolt/Skeleton/SkeletalAnimation.cpp", |
| 131 | + "Jolt/Skeleton/Skeleton.cpp", |
| 132 | + "Jolt/Skeleton/SkeletonMapper.cpp", |
| 133 | + "Jolt/Skeleton/SkeletonPose.cpp", |
| 134 | + "Jolt/TriangleGrouper/TriangleGrouperClosestCentroid.cpp", |
| 135 | + "Jolt/TriangleGrouper/TriangleGrouperMorton.cpp", |
| 136 | + "Jolt/TriangleSplitter/TriangleSplitter.cpp", |
| 137 | + "Jolt/TriangleSplitter/TriangleSplitterBinning.cpp", |
| 138 | + "Jolt/TriangleSplitter/TriangleSplitterFixedLeafSize.cpp", |
| 139 | + "Jolt/TriangleSplitter/TriangleSplitterLongestAxis.cpp", |
| 140 | + "Jolt/TriangleSplitter/TriangleSplitterMean.cpp", |
| 141 | + "Jolt/TriangleSplitter/TriangleSplitterMorton.cpp", |
| 142 | +] |
| 143 | + |
| 144 | +thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] |
| 145 | + |
| 146 | +env_jolt.Prepend(CPPPATH=[thirdparty_dir]) |
| 147 | + |
| 148 | +if env.dev_build: |
| 149 | + env_jolt.Append(CPPDEFINES=["JPH_ENABLE_ASSERTS"]) |
| 150 | + |
| 151 | +if env.editor_build: |
| 152 | + env_jolt.Append(CPPDEFINES=["JPH_DEBUG_RENDERER"]) |
| 153 | + |
| 154 | +if env["precision"] == "double": |
| 155 | + env_jolt.Append(CPPDEFINES=["JPH_DOUBLE_PRECISION"]) |
| 156 | + |
| 157 | +env_thirdparty = env_jolt.Clone() |
| 158 | +env_thirdparty.disable_warnings() |
| 159 | + |
| 160 | +thirdparty_obj = [] |
| 161 | +env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources) |
| 162 | +env.modules_sources += thirdparty_obj |
| 163 | + |
| 164 | +# Godot source files |
| 165 | + |
| 166 | +module_obj = [] |
| 167 | + |
| 168 | +env_jolt.add_source_files(module_obj, "*.cpp") |
| 169 | +env_jolt.add_source_files(module_obj, "joints/*.cpp") |
| 170 | +env_jolt.add_source_files(module_obj, "misc/*.cpp") |
| 171 | +env_jolt.add_source_files(module_obj, "objects/*.cpp") |
| 172 | +env_jolt.add_source_files(module_obj, "shapes/*.cpp") |
| 173 | +env_jolt.add_source_files(module_obj, "spaces/*.cpp") |
| 174 | +env.modules_sources += module_obj |
| 175 | + |
| 176 | +# Needed to force rebuilding the module files when the thirdparty library is updated. |
| 177 | +env.Depends(module_obj, thirdparty_obj) |
0 commit comments