Jolt.cmake 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704
  1. # Requires C++ 17
  2. set(CMAKE_CXX_STANDARD 17)
  3. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  4. set(CMAKE_CXX_EXTENSIONS OFF)
  5. # Root
  6. set(JOLT_PHYSICS_ROOT ${PHYSICS_REPO_ROOT}/Jolt)
  7. # Source files
  8. set(JOLT_PHYSICS_SRC_FILES
  9. ${JOLT_PHYSICS_ROOT}/AABBTree/AABBTreeBuilder.cpp
  10. ${JOLT_PHYSICS_ROOT}/AABBTree/AABBTreeBuilder.h
  11. ${JOLT_PHYSICS_ROOT}/AABBTree/AABBTreeToBuffer.h
  12. ${JOLT_PHYSICS_ROOT}/AABBTree/NodeCodec/NodeCodecQuadTreeHalfFloat.h
  13. ${JOLT_PHYSICS_ROOT}/AABBTree/TriangleCodec/TriangleCodecIndexed8BitPackSOA4Flags.h
  14. ${JOLT_PHYSICS_ROOT}/ConfigurationString.h
  15. ${JOLT_PHYSICS_ROOT}/Core/ARMNeon.h
  16. ${JOLT_PHYSICS_ROOT}/Core/Array.h
  17. ${JOLT_PHYSICS_ROOT}/Core/Atomics.h
  18. ${JOLT_PHYSICS_ROOT}/Core/BinaryHeap.h
  19. ${JOLT_PHYSICS_ROOT}/Core/ByteBuffer.h
  20. ${JOLT_PHYSICS_ROOT}/Core/Color.cpp
  21. ${JOLT_PHYSICS_ROOT}/Core/Color.h
  22. ${JOLT_PHYSICS_ROOT}/Core/Core.h
  23. ${JOLT_PHYSICS_ROOT}/Core/Factory.cpp
  24. ${JOLT_PHYSICS_ROOT}/Core/Factory.h
  25. ${JOLT_PHYSICS_ROOT}/Core/FixedSizeFreeList.h
  26. ${JOLT_PHYSICS_ROOT}/Core/FixedSizeFreeList.inl
  27. ${JOLT_PHYSICS_ROOT}/Core/FPControlWord.h
  28. ${JOLT_PHYSICS_ROOT}/Core/FPException.h
  29. ${JOLT_PHYSICS_ROOT}/Core/FPFlushDenormals.h
  30. ${JOLT_PHYSICS_ROOT}/Core/HashCombine.h
  31. ${JOLT_PHYSICS_ROOT}/Core/HashTable.h
  32. ${JOLT_PHYSICS_ROOT}/Core/InsertionSort.h
  33. ${JOLT_PHYSICS_ROOT}/Core/IssueReporting.cpp
  34. ${JOLT_PHYSICS_ROOT}/Core/IssueReporting.h
  35. ${JOLT_PHYSICS_ROOT}/Core/JobSystem.h
  36. ${JOLT_PHYSICS_ROOT}/Core/JobSystem.inl
  37. ${JOLT_PHYSICS_ROOT}/Core/JobSystemSingleThreaded.cpp
  38. ${JOLT_PHYSICS_ROOT}/Core/JobSystemSingleThreaded.h
  39. ${JOLT_PHYSICS_ROOT}/Core/JobSystemThreadPool.cpp
  40. ${JOLT_PHYSICS_ROOT}/Core/JobSystemThreadPool.h
  41. ${JOLT_PHYSICS_ROOT}/Core/JobSystemWithBarrier.cpp
  42. ${JOLT_PHYSICS_ROOT}/Core/JobSystemWithBarrier.h
  43. ${JOLT_PHYSICS_ROOT}/Core/LinearCurve.cpp
  44. ${JOLT_PHYSICS_ROOT}/Core/LinearCurve.h
  45. ${JOLT_PHYSICS_ROOT}/Core/LockFreeHashMap.h
  46. ${JOLT_PHYSICS_ROOT}/Core/LockFreeHashMap.inl
  47. ${JOLT_PHYSICS_ROOT}/Core/Memory.cpp
  48. ${JOLT_PHYSICS_ROOT}/Core/Memory.h
  49. ${JOLT_PHYSICS_ROOT}/Core/Mutex.h
  50. ${JOLT_PHYSICS_ROOT}/Core/MutexArray.h
  51. ${JOLT_PHYSICS_ROOT}/Core/NonCopyable.h
  52. ${JOLT_PHYSICS_ROOT}/Core/Profiler.cpp
  53. ${JOLT_PHYSICS_ROOT}/Core/Profiler.h
  54. ${JOLT_PHYSICS_ROOT}/Core/Profiler.inl
  55. ${JOLT_PHYSICS_ROOT}/Core/QuickSort.h
  56. ${JOLT_PHYSICS_ROOT}/Core/Reference.h
  57. ${JOLT_PHYSICS_ROOT}/Core/Result.h
  58. ${JOLT_PHYSICS_ROOT}/Core/RTTI.cpp
  59. ${JOLT_PHYSICS_ROOT}/Core/RTTI.h
  60. ${JOLT_PHYSICS_ROOT}/Core/ScopeExit.h
  61. ${JOLT_PHYSICS_ROOT}/Core/Semaphore.cpp
  62. ${JOLT_PHYSICS_ROOT}/Core/Semaphore.h
  63. ${JOLT_PHYSICS_ROOT}/Core/StaticArray.h
  64. ${JOLT_PHYSICS_ROOT}/Core/STLAlignedAllocator.h
  65. ${JOLT_PHYSICS_ROOT}/Core/STLAllocator.h
  66. ${JOLT_PHYSICS_ROOT}/Core/STLLocalAllocator.h
  67. ${JOLT_PHYSICS_ROOT}/Core/STLTempAllocator.h
  68. ${JOLT_PHYSICS_ROOT}/Core/StreamIn.h
  69. ${JOLT_PHYSICS_ROOT}/Core/StreamOut.h
  70. ${JOLT_PHYSICS_ROOT}/Core/StreamUtils.h
  71. ${JOLT_PHYSICS_ROOT}/Core/StreamWrapper.h
  72. ${JOLT_PHYSICS_ROOT}/Core/StridedPtr.h
  73. ${JOLT_PHYSICS_ROOT}/Core/StringTools.cpp
  74. ${JOLT_PHYSICS_ROOT}/Core/StringTools.h
  75. ${JOLT_PHYSICS_ROOT}/Core/TempAllocator.h
  76. ${JOLT_PHYSICS_ROOT}/Core/TickCounter.cpp
  77. ${JOLT_PHYSICS_ROOT}/Core/TickCounter.h
  78. ${JOLT_PHYSICS_ROOT}/Core/UnorderedMap.h
  79. ${JOLT_PHYSICS_ROOT}/Core/UnorderedSet.h
  80. ${JOLT_PHYSICS_ROOT}/Geometry/AABox.h
  81. ${JOLT_PHYSICS_ROOT}/Geometry/AABox4.h
  82. ${JOLT_PHYSICS_ROOT}/Geometry/ClipPoly.h
  83. ${JOLT_PHYSICS_ROOT}/Geometry/ClosestPoint.h
  84. ${JOLT_PHYSICS_ROOT}/Geometry/ConvexHullBuilder.cpp
  85. ${JOLT_PHYSICS_ROOT}/Geometry/ConvexHullBuilder.h
  86. ${JOLT_PHYSICS_ROOT}/Geometry/ConvexHullBuilder2D.cpp
  87. ${JOLT_PHYSICS_ROOT}/Geometry/ConvexHullBuilder2D.h
  88. ${JOLT_PHYSICS_ROOT}/Geometry/ConvexSupport.h
  89. ${JOLT_PHYSICS_ROOT}/Geometry/Ellipse.h
  90. ${JOLT_PHYSICS_ROOT}/Geometry/EPAConvexHullBuilder.h
  91. ${JOLT_PHYSICS_ROOT}/Geometry/EPAPenetrationDepth.h
  92. ${JOLT_PHYSICS_ROOT}/Geometry/GJKClosestPoint.h
  93. ${JOLT_PHYSICS_ROOT}/Geometry/IndexedTriangle.h
  94. ${JOLT_PHYSICS_ROOT}/Geometry/Indexify.cpp
  95. ${JOLT_PHYSICS_ROOT}/Geometry/Indexify.h
  96. ${JOLT_PHYSICS_ROOT}/Geometry/MortonCode.h
  97. ${JOLT_PHYSICS_ROOT}/Geometry/OrientedBox.cpp
  98. ${JOLT_PHYSICS_ROOT}/Geometry/OrientedBox.h
  99. ${JOLT_PHYSICS_ROOT}/Geometry/Plane.h
  100. ${JOLT_PHYSICS_ROOT}/Geometry/RayAABox.h
  101. ${JOLT_PHYSICS_ROOT}/Geometry/RayCapsule.h
  102. ${JOLT_PHYSICS_ROOT}/Geometry/RayCylinder.h
  103. ${JOLT_PHYSICS_ROOT}/Geometry/RaySphere.h
  104. ${JOLT_PHYSICS_ROOT}/Geometry/RayTriangle.h
  105. ${JOLT_PHYSICS_ROOT}/Geometry/Sphere.h
  106. ${JOLT_PHYSICS_ROOT}/Geometry/Triangle.h
  107. ${JOLT_PHYSICS_ROOT}/Jolt.cmake
  108. ${JOLT_PHYSICS_ROOT}/Jolt.h
  109. ${JOLT_PHYSICS_ROOT}/Math/BVec16.h
  110. ${JOLT_PHYSICS_ROOT}/Math/BVec16.inl
  111. ${JOLT_PHYSICS_ROOT}/Math/DMat44.h
  112. ${JOLT_PHYSICS_ROOT}/Math/DMat44.inl
  113. ${JOLT_PHYSICS_ROOT}/Math/Double3.h
  114. ${JOLT_PHYSICS_ROOT}/Math/DVec3.h
  115. ${JOLT_PHYSICS_ROOT}/Math/DVec3.inl
  116. ${JOLT_PHYSICS_ROOT}/Math/DynMatrix.h
  117. ${JOLT_PHYSICS_ROOT}/Math/EigenValueSymmetric.h
  118. ${JOLT_PHYSICS_ROOT}/Math/FindRoot.h
  119. ${JOLT_PHYSICS_ROOT}/Math/Float2.h
  120. ${JOLT_PHYSICS_ROOT}/Math/Float3.h
  121. ${JOLT_PHYSICS_ROOT}/Math/Float4.h
  122. ${JOLT_PHYSICS_ROOT}/Math/GaussianElimination.h
  123. ${JOLT_PHYSICS_ROOT}/Math/HalfFloat.h
  124. ${JOLT_PHYSICS_ROOT}/Math/Mat44.h
  125. ${JOLT_PHYSICS_ROOT}/Math/Mat44.inl
  126. ${JOLT_PHYSICS_ROOT}/Math/Math.h
  127. ${JOLT_PHYSICS_ROOT}/Math/MathTypes.h
  128. ${JOLT_PHYSICS_ROOT}/Math/Matrix.h
  129. ${JOLT_PHYSICS_ROOT}/Math/Quat.h
  130. ${JOLT_PHYSICS_ROOT}/Math/Quat.inl
  131. ${JOLT_PHYSICS_ROOT}/Math/Real.h
  132. ${JOLT_PHYSICS_ROOT}/Math/Swizzle.h
  133. ${JOLT_PHYSICS_ROOT}/Math/Trigonometry.h
  134. ${JOLT_PHYSICS_ROOT}/Math/UVec4.h
  135. ${JOLT_PHYSICS_ROOT}/Math/UVec4.inl
  136. ${JOLT_PHYSICS_ROOT}/Math/Vec3.cpp
  137. ${JOLT_PHYSICS_ROOT}/Math/Vec3.h
  138. ${JOLT_PHYSICS_ROOT}/Math/Vec3.inl
  139. ${JOLT_PHYSICS_ROOT}/Math/Vec4.h
  140. ${JOLT_PHYSICS_ROOT}/Math/Vec4.inl
  141. ${JOLT_PHYSICS_ROOT}/Math/Vector.h
  142. ${JOLT_PHYSICS_ROOT}/ObjectStream/ObjectStream.h
  143. ${JOLT_PHYSICS_ROOT}/ObjectStream/SerializableAttribute.h
  144. ${JOLT_PHYSICS_ROOT}/ObjectStream/SerializableAttributeEnum.h
  145. ${JOLT_PHYSICS_ROOT}/ObjectStream/SerializableAttributeTyped.h
  146. ${JOLT_PHYSICS_ROOT}/ObjectStream/SerializableObject.cpp
  147. ${JOLT_PHYSICS_ROOT}/ObjectStream/SerializableObject.h
  148. ${JOLT_PHYSICS_ROOT}/ObjectStream/TypeDeclarations.h
  149. ${JOLT_PHYSICS_ROOT}/Physics/Body/AllowedDOFs.h
  150. ${JOLT_PHYSICS_ROOT}/Physics/Body/Body.cpp
  151. ${JOLT_PHYSICS_ROOT}/Physics/Body/Body.h
  152. ${JOLT_PHYSICS_ROOT}/Physics/Body/Body.inl
  153. ${JOLT_PHYSICS_ROOT}/Physics/Body/BodyAccess.h
  154. ${JOLT_PHYSICS_ROOT}/Physics/Body/BodyActivationListener.h
  155. ${JOLT_PHYSICS_ROOT}/Physics/Body/BodyCreationSettings.cpp
  156. ${JOLT_PHYSICS_ROOT}/Physics/Body/BodyCreationSettings.h
  157. ${JOLT_PHYSICS_ROOT}/Physics/Body/BodyFilter.h
  158. ${JOLT_PHYSICS_ROOT}/Physics/Body/BodyID.h
  159. ${JOLT_PHYSICS_ROOT}/Physics/Body/BodyInterface.cpp
  160. ${JOLT_PHYSICS_ROOT}/Physics/Body/BodyInterface.h
  161. ${JOLT_PHYSICS_ROOT}/Physics/Body/BodyLock.h
  162. ${JOLT_PHYSICS_ROOT}/Physics/Body/BodyLockInterface.h
  163. ${JOLT_PHYSICS_ROOT}/Physics/Body/BodyLockMulti.h
  164. ${JOLT_PHYSICS_ROOT}/Physics/Body/BodyManager.cpp
  165. ${JOLT_PHYSICS_ROOT}/Physics/Body/BodyManager.h
  166. ${JOLT_PHYSICS_ROOT}/Physics/Body/BodyPair.h
  167. ${JOLT_PHYSICS_ROOT}/Physics/Body/BodyType.h
  168. ${JOLT_PHYSICS_ROOT}/Physics/Body/MassProperties.cpp
  169. ${JOLT_PHYSICS_ROOT}/Physics/Body/MassProperties.h
  170. ${JOLT_PHYSICS_ROOT}/Physics/Body/MotionProperties.cpp
  171. ${JOLT_PHYSICS_ROOT}/Physics/Body/MotionProperties.h
  172. ${JOLT_PHYSICS_ROOT}/Physics/Body/MotionProperties.inl
  173. ${JOLT_PHYSICS_ROOT}/Physics/Body/MotionQuality.h
  174. ${JOLT_PHYSICS_ROOT}/Physics/Body/MotionType.h
  175. ${JOLT_PHYSICS_ROOT}/Physics/Character/Character.cpp
  176. ${JOLT_PHYSICS_ROOT}/Physics/Character/Character.h
  177. ${JOLT_PHYSICS_ROOT}/Physics/Character/CharacterBase.cpp
  178. ${JOLT_PHYSICS_ROOT}/Physics/Character/CharacterBase.h
  179. ${JOLT_PHYSICS_ROOT}/Physics/Character/CharacterID.h
  180. ${JOLT_PHYSICS_ROOT}/Physics/Character/CharacterVirtual.cpp
  181. ${JOLT_PHYSICS_ROOT}/Physics/Character/CharacterVirtual.h
  182. ${JOLT_PHYSICS_ROOT}/Physics/Collision/AABoxCast.h
  183. ${JOLT_PHYSICS_ROOT}/Physics/Collision/ActiveEdgeMode.h
  184. ${JOLT_PHYSICS_ROOT}/Physics/Collision/ActiveEdges.h
  185. ${JOLT_PHYSICS_ROOT}/Physics/Collision/BackFaceMode.h
  186. ${JOLT_PHYSICS_ROOT}/Physics/Collision/BroadPhase/BroadPhase.cpp
  187. ${JOLT_PHYSICS_ROOT}/Physics/Collision/BroadPhase/BroadPhase.h
  188. ${JOLT_PHYSICS_ROOT}/Physics/Collision/BroadPhase/BroadPhaseBruteForce.cpp
  189. ${JOLT_PHYSICS_ROOT}/Physics/Collision/BroadPhase/BroadPhaseBruteForce.h
  190. ${JOLT_PHYSICS_ROOT}/Physics/Collision/BroadPhase/BroadPhaseLayer.h
  191. ${JOLT_PHYSICS_ROOT}/Physics/Collision/BroadPhase/BroadPhaseLayerInterfaceMask.h
  192. ${JOLT_PHYSICS_ROOT}/Physics/Collision/BroadPhase/BroadPhaseLayerInterfaceTable.h
  193. ${JOLT_PHYSICS_ROOT}/Physics/Collision/BroadPhase/BroadPhaseQuadTree.cpp
  194. ${JOLT_PHYSICS_ROOT}/Physics/Collision/BroadPhase/BroadPhaseQuadTree.h
  195. ${JOLT_PHYSICS_ROOT}/Physics/Collision/BroadPhase/BroadPhaseQuery.h
  196. ${JOLT_PHYSICS_ROOT}/Physics/Collision/BroadPhase/ObjectVsBroadPhaseLayerFilterMask.h
  197. ${JOLT_PHYSICS_ROOT}/Physics/Collision/BroadPhase/ObjectVsBroadPhaseLayerFilterTable.h
  198. ${JOLT_PHYSICS_ROOT}/Physics/Collision/BroadPhase/QuadTree.cpp
  199. ${JOLT_PHYSICS_ROOT}/Physics/Collision/BroadPhase/QuadTree.h
  200. ${JOLT_PHYSICS_ROOT}/Physics/Collision/CastConvexVsTriangles.cpp
  201. ${JOLT_PHYSICS_ROOT}/Physics/Collision/CastConvexVsTriangles.h
  202. ${JOLT_PHYSICS_ROOT}/Physics/Collision/CastResult.h
  203. ${JOLT_PHYSICS_ROOT}/Physics/Collision/CastSphereVsTriangles.cpp
  204. ${JOLT_PHYSICS_ROOT}/Physics/Collision/CastSphereVsTriangles.h
  205. ${JOLT_PHYSICS_ROOT}/Physics/Collision/CollectFacesMode.h
  206. ${JOLT_PHYSICS_ROOT}/Physics/Collision/CollideConvexVsTriangles.cpp
  207. ${JOLT_PHYSICS_ROOT}/Physics/Collision/CollideConvexVsTriangles.h
  208. ${JOLT_PHYSICS_ROOT}/Physics/Collision/CollidePointResult.h
  209. ${JOLT_PHYSICS_ROOT}/Physics/Collision/CollideShape.h
  210. ${JOLT_PHYSICS_ROOT}/Physics/Collision/CollideShapeVsShapePerLeaf.h
  211. ${JOLT_PHYSICS_ROOT}/Physics/Collision/CollideSoftBodyVertexIterator.h
  212. ${JOLT_PHYSICS_ROOT}/Physics/Collision/CollideSoftBodyVerticesVsTriangles.h
  213. ${JOLT_PHYSICS_ROOT}/Physics/Collision/CollideSphereVsTriangles.cpp
  214. ${JOLT_PHYSICS_ROOT}/Physics/Collision/CollideSphereVsTriangles.h
  215. ${JOLT_PHYSICS_ROOT}/Physics/Collision/CollisionCollector.h
  216. ${JOLT_PHYSICS_ROOT}/Physics/Collision/CollisionCollectorImpl.h
  217. ${JOLT_PHYSICS_ROOT}/Physics/Collision/CollisionDispatch.cpp
  218. ${JOLT_PHYSICS_ROOT}/Physics/Collision/CollisionDispatch.h
  219. ${JOLT_PHYSICS_ROOT}/Physics/Collision/CollisionGroup.cpp
  220. ${JOLT_PHYSICS_ROOT}/Physics/Collision/CollisionGroup.h
  221. ${JOLT_PHYSICS_ROOT}/Physics/Collision/ContactListener.h
  222. ${JOLT_PHYSICS_ROOT}/Physics/Collision/EstimateCollisionResponse.cpp
  223. ${JOLT_PHYSICS_ROOT}/Physics/Collision/EstimateCollisionResponse.h
  224. ${JOLT_PHYSICS_ROOT}/Physics/Collision/GroupFilter.cpp
  225. ${JOLT_PHYSICS_ROOT}/Physics/Collision/GroupFilter.h
  226. ${JOLT_PHYSICS_ROOT}/Physics/Collision/GroupFilterTable.cpp
  227. ${JOLT_PHYSICS_ROOT}/Physics/Collision/GroupFilterTable.h
  228. ${JOLT_PHYSICS_ROOT}/Physics/Collision/InternalEdgeRemovingCollector.h
  229. ${JOLT_PHYSICS_ROOT}/Physics/Collision/ManifoldBetweenTwoFaces.cpp
  230. ${JOLT_PHYSICS_ROOT}/Physics/Collision/ManifoldBetweenTwoFaces.h
  231. ${JOLT_PHYSICS_ROOT}/Physics/Collision/NarrowPhaseQuery.cpp
  232. ${JOLT_PHYSICS_ROOT}/Physics/Collision/NarrowPhaseQuery.h
  233. ${JOLT_PHYSICS_ROOT}/Physics/Collision/NarrowPhaseStats.cpp
  234. ${JOLT_PHYSICS_ROOT}/Physics/Collision/NarrowPhaseStats.h
  235. ${JOLT_PHYSICS_ROOT}/Physics/Collision/ObjectLayer.h
  236. ${JOLT_PHYSICS_ROOT}/Physics/Collision/ObjectLayerPairFilterMask.h
  237. ${JOLT_PHYSICS_ROOT}/Physics/Collision/ObjectLayerPairFilterTable.h
  238. ${JOLT_PHYSICS_ROOT}/Physics/Collision/PhysicsMaterial.cpp
  239. ${JOLT_PHYSICS_ROOT}/Physics/Collision/PhysicsMaterial.h
  240. ${JOLT_PHYSICS_ROOT}/Physics/Collision/PhysicsMaterialSimple.cpp
  241. ${JOLT_PHYSICS_ROOT}/Physics/Collision/PhysicsMaterialSimple.h
  242. ${JOLT_PHYSICS_ROOT}/Physics/Collision/RayCast.h
  243. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/BoxShape.cpp
  244. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/BoxShape.h
  245. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/CapsuleShape.cpp
  246. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/CapsuleShape.h
  247. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/CompoundShape.cpp
  248. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/CompoundShape.h
  249. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/CompoundShapeVisitors.h
  250. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/ConvexHullShape.cpp
  251. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/ConvexHullShape.h
  252. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/ConvexShape.cpp
  253. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/ConvexShape.h
  254. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/CylinderShape.cpp
  255. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/CylinderShape.h
  256. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/DecoratedShape.cpp
  257. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/DecoratedShape.h
  258. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/EmptyShape.cpp
  259. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/EmptyShape.h
  260. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/GetTrianglesContext.h
  261. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/HeightFieldShape.cpp
  262. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/HeightFieldShape.h
  263. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/MeshShape.cpp
  264. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/MeshShape.h
  265. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/MutableCompoundShape.cpp
  266. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/MutableCompoundShape.h
  267. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/OffsetCenterOfMassShape.cpp
  268. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/OffsetCenterOfMassShape.h
  269. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/PlaneShape.cpp
  270. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/PlaneShape.h
  271. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/PolyhedronSubmergedVolumeCalculator.h
  272. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/RotatedTranslatedShape.cpp
  273. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/RotatedTranslatedShape.h
  274. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/ScaledShape.cpp
  275. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/ScaledShape.h
  276. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/ScaleHelpers.h
  277. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/Shape.cpp
  278. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/Shape.h
  279. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/SphereShape.cpp
  280. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/SphereShape.h
  281. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/StaticCompoundShape.cpp
  282. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/StaticCompoundShape.h
  283. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/SubShapeID.h
  284. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/SubShapeIDPair.h
  285. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/TaperedCapsuleShape.cpp
  286. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/TaperedCapsuleShape.gliffy
  287. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/TaperedCapsuleShape.h
  288. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/TaperedCylinderShape.cpp
  289. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/TaperedCylinderShape.h
  290. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/TriangleShape.cpp
  291. ${JOLT_PHYSICS_ROOT}/Physics/Collision/Shape/TriangleShape.h
  292. ${JOLT_PHYSICS_ROOT}/Physics/Collision/ShapeCast.h
  293. ${JOLT_PHYSICS_ROOT}/Physics/Collision/ShapeFilter.h
  294. ${JOLT_PHYSICS_ROOT}/Physics/Collision/SimShapeFilter.h
  295. ${JOLT_PHYSICS_ROOT}/Physics/Collision/SimShapeFilterWrapper.h
  296. ${JOLT_PHYSICS_ROOT}/Physics/Collision/SortReverseAndStore.h
  297. ${JOLT_PHYSICS_ROOT}/Physics/Collision/TransformedShape.cpp
  298. ${JOLT_PHYSICS_ROOT}/Physics/Collision/TransformedShape.h
  299. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/CalculateSolverSteps.h
  300. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/ConeConstraint.cpp
  301. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/ConeConstraint.h
  302. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/Constraint.cpp
  303. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/Constraint.h
  304. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/ConstraintManager.cpp
  305. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/ConstraintManager.h
  306. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/ConstraintPart/AngleConstraintPart.h
  307. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/ConstraintPart/AxisConstraintPart.h
  308. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/ConstraintPart/DualAxisConstraintPart.h
  309. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/ConstraintPart/GearConstraintPart.h
  310. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/ConstraintPart/HingeRotationConstraintPart.h
  311. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/ConstraintPart/IndependentAxisConstraintPart.h
  312. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/ConstraintPart/PointConstraintPart.h
  313. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/ConstraintPart/RackAndPinionConstraintPart.h
  314. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/ConstraintPart/RotationEulerConstraintPart.h
  315. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/ConstraintPart/RotationQuatConstraintPart.h
  316. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/ConstraintPart/SpringPart.h
  317. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/ConstraintPart/SwingTwistConstraintPart.h
  318. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/ContactConstraintManager.cpp
  319. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/ContactConstraintManager.h
  320. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/DistanceConstraint.cpp
  321. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/DistanceConstraint.h
  322. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/FixedConstraint.cpp
  323. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/FixedConstraint.h
  324. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/GearConstraint.cpp
  325. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/GearConstraint.h
  326. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/HingeConstraint.cpp
  327. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/HingeConstraint.h
  328. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/MotorSettings.cpp
  329. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/MotorSettings.h
  330. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/PathConstraint.cpp
  331. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/PathConstraint.h
  332. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/PathConstraintPath.cpp
  333. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/PathConstraintPath.h
  334. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/PathConstraintPathHermite.cpp
  335. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/PathConstraintPathHermite.h
  336. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/PointConstraint.cpp
  337. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/PointConstraint.h
  338. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/PulleyConstraint.cpp
  339. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/PulleyConstraint.h
  340. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/RackAndPinionConstraint.cpp
  341. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/RackAndPinionConstraint.h
  342. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/SixDOFConstraint.cpp
  343. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/SixDOFConstraint.h
  344. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/SliderConstraint.cpp
  345. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/SliderConstraint.h
  346. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/SpringSettings.cpp
  347. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/SpringSettings.h
  348. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/SwingTwistConstraint.cpp
  349. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/SwingTwistConstraint.h
  350. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/TwoBodyConstraint.cpp
  351. ${JOLT_PHYSICS_ROOT}/Physics/Constraints/TwoBodyConstraint.h
  352. ${JOLT_PHYSICS_ROOT}/Physics/DeterminismLog.cpp
  353. ${JOLT_PHYSICS_ROOT}/Physics/DeterminismLog.h
  354. ${JOLT_PHYSICS_ROOT}/Physics/EActivation.h
  355. ${JOLT_PHYSICS_ROOT}/Physics/EPhysicsUpdateError.h
  356. ${JOLT_PHYSICS_ROOT}/Physics/IslandBuilder.cpp
  357. ${JOLT_PHYSICS_ROOT}/Physics/IslandBuilder.h
  358. ${JOLT_PHYSICS_ROOT}/Physics/LargeIslandSplitter.cpp
  359. ${JOLT_PHYSICS_ROOT}/Physics/LargeIslandSplitter.h
  360. ${JOLT_PHYSICS_ROOT}/Physics/PhysicsLock.h
  361. ${JOLT_PHYSICS_ROOT}/Physics/PhysicsScene.cpp
  362. ${JOLT_PHYSICS_ROOT}/Physics/PhysicsScene.h
  363. ${JOLT_PHYSICS_ROOT}/Physics/PhysicsSettings.h
  364. ${JOLT_PHYSICS_ROOT}/Physics/PhysicsStepListener.h
  365. ${JOLT_PHYSICS_ROOT}/Physics/PhysicsSystem.cpp
  366. ${JOLT_PHYSICS_ROOT}/Physics/PhysicsSystem.h
  367. ${JOLT_PHYSICS_ROOT}/Physics/PhysicsUpdateContext.cpp
  368. ${JOLT_PHYSICS_ROOT}/Physics/PhysicsUpdateContext.h
  369. ${JOLT_PHYSICS_ROOT}/Physics/Ragdoll/Ragdoll.cpp
  370. ${JOLT_PHYSICS_ROOT}/Physics/Ragdoll/Ragdoll.h
  371. ${JOLT_PHYSICS_ROOT}/Physics/SoftBody/SoftBodyContactListener.h
  372. ${JOLT_PHYSICS_ROOT}/Physics/SoftBody/SoftBodyCreationSettings.cpp
  373. ${JOLT_PHYSICS_ROOT}/Physics/SoftBody/SoftBodyCreationSettings.h
  374. ${JOLT_PHYSICS_ROOT}/Physics/SoftBody/SoftBodyManifold.h
  375. ${JOLT_PHYSICS_ROOT}/Physics/SoftBody/SoftBodyMotionProperties.cpp
  376. ${JOLT_PHYSICS_ROOT}/Physics/SoftBody/SoftBodyMotionProperties.h
  377. ${JOLT_PHYSICS_ROOT}/Physics/SoftBody/SoftBodyShape.cpp
  378. ${JOLT_PHYSICS_ROOT}/Physics/SoftBody/SoftBodyShape.h
  379. ${JOLT_PHYSICS_ROOT}/Physics/SoftBody/SoftBodySharedSettings.cpp
  380. ${JOLT_PHYSICS_ROOT}/Physics/SoftBody/SoftBodySharedSettings.h
  381. ${JOLT_PHYSICS_ROOT}/Physics/SoftBody/SoftBodyUpdateContext.h
  382. ${JOLT_PHYSICS_ROOT}/Physics/SoftBody/SoftBodyVertex.h
  383. ${JOLT_PHYSICS_ROOT}/Physics/StateRecorder.h
  384. ${JOLT_PHYSICS_ROOT}/Physics/StateRecorderImpl.cpp
  385. ${JOLT_PHYSICS_ROOT}/Physics/StateRecorderImpl.h
  386. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/MotorcycleController.cpp
  387. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/MotorcycleController.h
  388. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/TrackedVehicleController.cpp
  389. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/TrackedVehicleController.h
  390. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/VehicleAntiRollBar.cpp
  391. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/VehicleAntiRollBar.h
  392. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/VehicleCollisionTester.cpp
  393. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/VehicleCollisionTester.h
  394. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/VehicleConstraint.cpp
  395. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/VehicleConstraint.h
  396. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/VehicleController.cpp
  397. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/VehicleController.h
  398. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/VehicleDifferential.cpp
  399. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/VehicleDifferential.h
  400. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/VehicleEngine.cpp
  401. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/VehicleEngine.h
  402. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/VehicleTrack.cpp
  403. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/VehicleTrack.h
  404. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/VehicleTransmission.cpp
  405. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/VehicleTransmission.h
  406. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/Wheel.cpp
  407. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/Wheel.h
  408. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/WheeledVehicleController.cpp
  409. ${JOLT_PHYSICS_ROOT}/Physics/Vehicle/WheeledVehicleController.h
  410. ${JOLT_PHYSICS_ROOT}/RegisterTypes.cpp
  411. ${JOLT_PHYSICS_ROOT}/RegisterTypes.h
  412. ${JOLT_PHYSICS_ROOT}/Renderer/DebugRenderer.cpp
  413. ${JOLT_PHYSICS_ROOT}/Renderer/DebugRenderer.h
  414. ${JOLT_PHYSICS_ROOT}/Renderer/DebugRendererPlayback.cpp
  415. ${JOLT_PHYSICS_ROOT}/Renderer/DebugRendererPlayback.h
  416. ${JOLT_PHYSICS_ROOT}/Renderer/DebugRendererRecorder.cpp
  417. ${JOLT_PHYSICS_ROOT}/Renderer/DebugRendererRecorder.h
  418. ${JOLT_PHYSICS_ROOT}/Renderer/DebugRendererSimple.cpp
  419. ${JOLT_PHYSICS_ROOT}/Renderer/DebugRendererSimple.h
  420. ${JOLT_PHYSICS_ROOT}/Skeleton/SkeletalAnimation.cpp
  421. ${JOLT_PHYSICS_ROOT}/Skeleton/SkeletalAnimation.h
  422. ${JOLT_PHYSICS_ROOT}/Skeleton/Skeleton.cpp
  423. ${JOLT_PHYSICS_ROOT}/Skeleton/Skeleton.h
  424. ${JOLT_PHYSICS_ROOT}/Skeleton/SkeletonMapper.cpp
  425. ${JOLT_PHYSICS_ROOT}/Skeleton/SkeletonMapper.h
  426. ${JOLT_PHYSICS_ROOT}/Skeleton/SkeletonPose.cpp
  427. ${JOLT_PHYSICS_ROOT}/Skeleton/SkeletonPose.h
  428. ${JOLT_PHYSICS_ROOT}/TriangleSplitter/TriangleSplitter.cpp
  429. ${JOLT_PHYSICS_ROOT}/TriangleSplitter/TriangleSplitter.h
  430. ${JOLT_PHYSICS_ROOT}/TriangleSplitter/TriangleSplitterBinning.cpp
  431. ${JOLT_PHYSICS_ROOT}/TriangleSplitter/TriangleSplitterBinning.h
  432. ${JOLT_PHYSICS_ROOT}/TriangleSplitter/TriangleSplitterMean.cpp
  433. ${JOLT_PHYSICS_ROOT}/TriangleSplitter/TriangleSplitterMean.h
  434. )
  435. if (ENABLE_OBJECT_STREAM)
  436. set(JOLT_PHYSICS_SRC_FILES
  437. ${JOLT_PHYSICS_SRC_FILES}
  438. ${JOLT_PHYSICS_ROOT}/ObjectStream/GetPrimitiveTypeOfType.h
  439. ${JOLT_PHYSICS_ROOT}/ObjectStream/ObjectStream.cpp
  440. ${JOLT_PHYSICS_ROOT}/ObjectStream/ObjectStreamBinaryIn.cpp
  441. ${JOLT_PHYSICS_ROOT}/ObjectStream/ObjectStreamBinaryIn.h
  442. ${JOLT_PHYSICS_ROOT}/ObjectStream/ObjectStreamBinaryOut.cpp
  443. ${JOLT_PHYSICS_ROOT}/ObjectStream/ObjectStreamBinaryOut.h
  444. ${JOLT_PHYSICS_ROOT}/ObjectStream/ObjectStreamIn.cpp
  445. ${JOLT_PHYSICS_ROOT}/ObjectStream/ObjectStreamIn.h
  446. ${JOLT_PHYSICS_ROOT}/ObjectStream/ObjectStreamOut.cpp
  447. ${JOLT_PHYSICS_ROOT}/ObjectStream/ObjectStreamOut.h
  448. ${JOLT_PHYSICS_ROOT}/ObjectStream/ObjectStreamTextIn.cpp
  449. ${JOLT_PHYSICS_ROOT}/ObjectStream/ObjectStreamTextIn.h
  450. ${JOLT_PHYSICS_ROOT}/ObjectStream/ObjectStreamTextOut.cpp
  451. ${JOLT_PHYSICS_ROOT}/ObjectStream/ObjectStreamTextOut.h
  452. ${JOLT_PHYSICS_ROOT}/ObjectStream/ObjectStreamTypes.h
  453. ${JOLT_PHYSICS_ROOT}/ObjectStream/TypeDeclarations.cpp
  454. )
  455. endif()
  456. if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
  457. # Add natvis file
  458. set(JOLT_PHYSICS_SRC_FILES ${JOLT_PHYSICS_SRC_FILES} ${JOLT_PHYSICS_ROOT}/Jolt.natvis)
  459. endif()
  460. # Group source files
  461. source_group(TREE ${JOLT_PHYSICS_ROOT} FILES ${JOLT_PHYSICS_SRC_FILES})
  462. # Create Jolt lib
  463. add_library(Jolt ${JOLT_PHYSICS_SRC_FILES})
  464. add_library(Jolt::Jolt ALIAS Jolt)
  465. if (BUILD_SHARED_LIBS)
  466. # Set default visibility to hidden
  467. set(CMAKE_CXX_VISIBILITY_PRESET hidden)
  468. if (GENERATE_DEBUG_SYMBOLS)
  469. if (MSVC)
  470. # MSVC specific option to enable PDB generation
  471. set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG:FASTLINK")
  472. else()
  473. # Clang/GCC option to enable debug symbol generation
  474. set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -g")
  475. endif()
  476. endif()
  477. # Set linker flags for other build types to be the same as release
  478. set(CMAKE_SHARED_LINKER_FLAGS_RELEASEASAN "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
  479. set(CMAKE_SHARED_LINKER_FLAGS_RELEASEUBSAN "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
  480. set(CMAKE_SHARED_LINKER_FLAGS_RELEASETSAN "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
  481. set(CMAKE_SHARED_LINKER_FLAGS_RELEASECOVERAGE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
  482. set(CMAKE_SHARED_LINKER_FLAGS_DISTRIBUTION "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
  483. # Public define to instruct user code to import Jolt symbols (rather than use static linking)
  484. target_compile_definitions(Jolt PUBLIC JPH_SHARED_LIBRARY)
  485. # Private define to instruct the library to export symbols for shared linking
  486. target_compile_definitions(Jolt PRIVATE JPH_BUILD_SHARED_LIBRARY)
  487. endif()
  488. # Use repository as include directory when building, install directory when installing
  489. target_include_directories(Jolt PUBLIC
  490. $<BUILD_INTERFACE:${PHYSICS_REPO_ROOT}>
  491. $<INSTALL_INTERFACE:include/>)
  492. # Code coverage doesn't work when using precompiled headers
  493. if (CMAKE_GENERATOR STREQUAL "Ninja Multi-Config" AND MSVC)
  494. # The Ninja Multi-Config generator errors out when selectively disabling precompiled headers for certain configurations.
  495. # See: https://github.com/jrouwe/JoltPhysics/issues/1211
  496. target_precompile_headers(Jolt PRIVATE "${JOLT_PHYSICS_ROOT}/Jolt.h")
  497. else()
  498. target_precompile_headers(Jolt PRIVATE "$<$<NOT:$<CONFIG:ReleaseCoverage>>:${JOLT_PHYSICS_ROOT}/Jolt.h>")
  499. endif()
  500. # Set the debug/non-debug build flags
  501. target_compile_definitions(Jolt PUBLIC "$<$<CONFIG:Debug>:_DEBUG>")
  502. target_compile_definitions(Jolt PUBLIC "$<$<CONFIG:Release,Distribution,ReleaseASAN,ReleaseUBSAN,ReleaseTSAN,ReleaseCoverage>:NDEBUG>")
  503. # ASAN and TSAN should use the default allocators
  504. target_compile_definitions(Jolt PUBLIC "$<$<CONFIG:ReleaseASAN,ReleaseTSAN>:JPH_DISABLE_TEMP_ALLOCATOR;JPH_DISABLE_CUSTOM_ALLOCATOR>")
  505. # Setting floating point exceptions
  506. if (FLOATING_POINT_EXCEPTIONS_ENABLED AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
  507. target_compile_definitions(Jolt PUBLIC "$<$<CONFIG:Debug,Release>:JPH_FLOATING_POINT_EXCEPTIONS_ENABLED>")
  508. endif()
  509. # Setting the disable custom allocator flag
  510. if (DISABLE_CUSTOM_ALLOCATOR)
  511. target_compile_definitions(Jolt PUBLIC JPH_DISABLE_CUSTOM_ALLOCATOR)
  512. endif()
  513. # Setting enable asserts flag
  514. if (USE_ASSERTS)
  515. target_compile_definitions(Jolt PUBLIC JPH_ENABLE_ASSERTS)
  516. endif()
  517. # Setting double precision flag
  518. if (DOUBLE_PRECISION)
  519. target_compile_definitions(Jolt PUBLIC JPH_DOUBLE_PRECISION)
  520. endif()
  521. # Setting to attempt cross platform determinism
  522. if (CROSS_PLATFORM_DETERMINISTIC)
  523. target_compile_definitions(Jolt PUBLIC JPH_CROSS_PLATFORM_DETERMINISTIC)
  524. endif()
  525. # Setting to determine number of bits in ObjectLayer
  526. if (OBJECT_LAYER_BITS)
  527. target_compile_definitions(Jolt PUBLIC JPH_OBJECT_LAYER_BITS=${OBJECT_LAYER_BITS})
  528. endif()
  529. if (USE_STD_VECTOR)
  530. target_compile_definitions(Jolt PUBLIC JPH_USE_STD_VECTOR)
  531. endif()
  532. # Setting to periodically trace broadphase stats to help determine if the broadphase layer configuration is optimal
  533. if (TRACK_BROADPHASE_STATS)
  534. target_compile_definitions(Jolt PUBLIC JPH_TRACK_BROADPHASE_STATS)
  535. endif()
  536. # Setting to periodically trace narrowphase stats to help determine which collision queries could be optimized
  537. if (TRACK_NARROWPHASE_STATS)
  538. target_compile_definitions(Jolt PUBLIC JPH_TRACK_NARROWPHASE_STATS)
  539. endif()
  540. # Setting to track simulation timings per body
  541. if (JPH_TRACK_SIMULATION_STATS)
  542. target_compile_definitions(Jolt PUBLIC JPH_TRACK_SIMULATION_STATS)
  543. endif()
  544. # Enable the debug renderer
  545. if (DEBUG_RENDERER_IN_DISTRIBUTION)
  546. target_compile_definitions(Jolt PUBLIC "JPH_DEBUG_RENDERER")
  547. elseif (DEBUG_RENDERER_IN_DEBUG_AND_RELEASE)
  548. target_compile_definitions(Jolt PUBLIC "$<$<CONFIG:Debug,Release,ReleaseASAN,ReleaseUBSAN,ReleaseTSAN>:JPH_DEBUG_RENDERER>")
  549. endif()
  550. # Enable the profiler
  551. if (JPH_USE_EXTERNAL_PROFILE)
  552. set(JOLT_PROFILE_DEFINE JPH_EXTERNAL_PROFILE)
  553. else()
  554. set(JOLT_PROFILE_DEFINE JPH_PROFILE_ENABLED)
  555. endif()
  556. if (PROFILER_IN_DISTRIBUTION)
  557. target_compile_definitions(Jolt PUBLIC "${JOLT_PROFILE_DEFINE}")
  558. elseif (PROFILER_IN_DEBUG_AND_RELEASE)
  559. target_compile_definitions(Jolt PUBLIC "$<$<CONFIG:Debug,Release,ReleaseASAN,ReleaseUBSAN,ReleaseTSAN>:${JOLT_PROFILE_DEFINE}>")
  560. endif()
  561. # Compile the ObjectStream class and RTTI attribute information
  562. if (ENABLE_OBJECT_STREAM)
  563. target_compile_definitions(Jolt PUBLIC JPH_OBJECT_STREAM)
  564. endif()
  565. # Emit the instruction set definitions to ensure that child projects use the same settings even if they override the used instruction sets (a mismatch causes link errors)
  566. function(EMIT_X86_INSTRUCTION_SET_DEFINITIONS)
  567. if (USE_AVX512)
  568. target_compile_definitions(Jolt PUBLIC JPH_USE_AVX512)
  569. endif()
  570. if (USE_AVX2)
  571. target_compile_definitions(Jolt PUBLIC JPH_USE_AVX2)
  572. endif()
  573. if (USE_AVX)
  574. target_compile_definitions(Jolt PUBLIC JPH_USE_AVX)
  575. endif()
  576. if (USE_SSE4_1)
  577. target_compile_definitions(Jolt PUBLIC JPH_USE_SSE4_1)
  578. endif()
  579. if (USE_SSE4_2)
  580. target_compile_definitions(Jolt PUBLIC JPH_USE_SSE4_2)
  581. endif()
  582. if (USE_LZCNT)
  583. target_compile_definitions(Jolt PUBLIC JPH_USE_LZCNT)
  584. endif()
  585. if (USE_TZCNT)
  586. target_compile_definitions(Jolt PUBLIC JPH_USE_TZCNT)
  587. endif()
  588. if (USE_F16C)
  589. target_compile_definitions(Jolt PUBLIC JPH_USE_F16C)
  590. endif()
  591. if (USE_FMADD AND NOT CROSS_PLATFORM_DETERMINISTIC)
  592. target_compile_definitions(Jolt PUBLIC JPH_USE_FMADD)
  593. endif()
  594. endfunction()
  595. # Add the compiler commandline flags to select the right instruction sets
  596. if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
  597. if ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x86" OR "${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
  598. if (USE_AVX512)
  599. target_compile_options(Jolt PUBLIC /arch:AVX512)
  600. elseif (USE_AVX2)
  601. target_compile_options(Jolt PUBLIC /arch:AVX2)
  602. elseif (USE_AVX)
  603. target_compile_options(Jolt PUBLIC /arch:AVX)
  604. endif()
  605. EMIT_X86_INSTRUCTION_SET_DEFINITIONS()
  606. endif()
  607. else()
  608. if (XCODE)
  609. # XCode builds for multiple architectures, we can't set global flags
  610. elseif (CROSS_COMPILE_ARM OR CMAKE_OSX_ARCHITECTURES MATCHES "arm64" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64")
  611. # ARM64 uses no special commandline flags
  612. elseif (EMSCRIPTEN)
  613. if (USE_WASM_SIMD)
  614. # Jolt currently doesn't implement the WASM specific SIMD intrinsics so uses the SSE 4.2 intrinsics
  615. # See: https://emscripten.org/docs/porting/simd.html#webassembly-simd-intrinsics
  616. # Note that this does not require the browser to actually support SSE 4.2 it merely means that it can translate those instructions to WASM SIMD instructions
  617. target_compile_options(Jolt PUBLIC -msimd128 -msse4.2)
  618. endif()
  619. if (JPH_USE_WASM64)
  620. target_compile_options(Jolt PUBLIC -sMEMORY64)
  621. target_link_options(Jolt PUBLIC -sMEMORY64)
  622. endif()
  623. elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i386")
  624. # x86 and x86_64
  625. # On 32-bit builds we need to default to using SSE instructions, the x87 FPU instructions have higher intermediate precision
  626. # which will cause problems in the collision detection code (the effect is similar to leaving FMA on, search for
  627. # JPH_PRECISE_MATH_ON for the locations where this is a problem).
  628. if (USE_AVX512)
  629. target_compile_options(Jolt PUBLIC -mavx512f -mavx512vl -mavx512dq -mavx2 -mbmi -mpopcnt -mlzcnt -mf16c)
  630. elseif (USE_AVX2)
  631. target_compile_options(Jolt PUBLIC -mavx2 -mbmi -mpopcnt -mlzcnt -mf16c)
  632. elseif (USE_AVX)
  633. target_compile_options(Jolt PUBLIC -mavx -mpopcnt)
  634. elseif (USE_SSE4_2)
  635. target_compile_options(Jolt PUBLIC -msse4.2 -mpopcnt)
  636. elseif (USE_SSE4_1)
  637. target_compile_options(Jolt PUBLIC -msse4.1)
  638. else()
  639. target_compile_options(Jolt PUBLIC -msse2)
  640. endif()
  641. if (USE_LZCNT)
  642. target_compile_options(Jolt PUBLIC -mlzcnt)
  643. endif()
  644. if (USE_TZCNT)
  645. target_compile_options(Jolt PUBLIC -mbmi)
  646. endif()
  647. if (USE_F16C)
  648. target_compile_options(Jolt PUBLIC -mf16c)
  649. endif()
  650. if (USE_FMADD AND NOT CROSS_PLATFORM_DETERMINISTIC)
  651. target_compile_options(Jolt PUBLIC -mfma)
  652. endif()
  653. if (NOT MSVC)
  654. target_compile_options(Jolt PUBLIC -mfpmath=sse)
  655. endif()
  656. EMIT_X86_INSTRUCTION_SET_DEFINITIONS()
  657. endif()
  658. endif()
  659. # On Unix flavors we need the pthread library
  660. if (NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") AND NOT EMSCRIPTEN)
  661. target_compile_options(Jolt PUBLIC -pthread)
  662. target_link_options(Jolt PUBLIC -pthread)
  663. endif()
  664. if (EMSCRIPTEN)
  665. # We need more than the default 64KB stack and 16MB memory
  666. # In your application, specify at least -sSTACK_SIZE=1048576 -sINITIAL_MEMORY=134217728
  667. # Also disable warning: running limited binaryen optimizations because DWARF info requested (or indirectly required)
  668. target_link_options(Jolt PUBLIC -Wno-limited-postlink-optimizations)
  669. endif()