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