ConfigurationString.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. // Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
  2. // SPDX-FileCopyrightText: 2023 Jorrit Rouwe
  3. // SPDX-License-Identifier: MIT
  4. #pragma once
  5. JPH_NAMESPACE_BEGIN
  6. /// Construct a string that lists the most important configuration settings
  7. inline const char *GetConfigurationString()
  8. {
  9. return JPH_IF_SINGLE_PRECISION_ELSE("Single", "Double") " precision "
  10. #if defined(JPH_CPU_X86)
  11. "x86 "
  12. #elif defined(JPH_CPU_ARM)
  13. "ARM "
  14. #elif defined(JPH_CPU_RISCV)
  15. "RISC-V "
  16. #elif defined(JPH_CPU_E2K)
  17. "E2K "
  18. #elif defined(JPH_CPU_WASM)
  19. "WASM "
  20. #else
  21. #error Unknown CPU architecture
  22. #endif
  23. #if JPH_CPU_ADDRESS_BITS == 64
  24. "64-bit "
  25. #elif JPH_CPU_ADDRESS_BITS == 32
  26. "32-bit "
  27. #endif
  28. "with instructions: "
  29. #ifdef JPH_USE_NEON
  30. "NEON "
  31. #endif
  32. #ifdef JPH_USE_SSE
  33. "SSE2 "
  34. #endif
  35. #ifdef JPH_USE_SSE4_1
  36. "SSE4.1 "
  37. #endif
  38. #ifdef JPH_USE_SSE4_2
  39. "SSE4.2 "
  40. #endif
  41. #ifdef JPH_USE_AVX
  42. "AVX "
  43. #endif
  44. #ifdef JPH_USE_AVX2
  45. "AVX2 "
  46. #endif
  47. #ifdef JPH_USE_AVX512
  48. "AVX512 "
  49. #endif
  50. #ifdef JPH_USE_F16C
  51. "F16C "
  52. #endif
  53. #ifdef JPH_USE_LZCNT
  54. "LZCNT "
  55. #endif
  56. #ifdef JPH_USE_TZCNT
  57. "TZCNT "
  58. #endif
  59. #ifdef JPH_USE_FMADD
  60. "FMADD "
  61. #endif
  62. #ifdef JPH_CROSS_PLATFORM_DETERMINISTIC
  63. "(Cross Platform Deterministic) "
  64. #endif
  65. #ifdef JPH_FLOATING_POINT_EXCEPTIONS_ENABLED
  66. "(FP Exceptions) "
  67. #endif
  68. #ifdef JPH_DEBUG_RENDERER
  69. "(Debug Renderer) "
  70. #endif
  71. #ifdef JPH_PROFILE_ENABLED
  72. "(Profile) "
  73. #endif
  74. #if defined(JPH_OBJECT_LAYER_BITS) && JPH_OBJECT_LAYER_BITS == 32
  75. "(32-bit ObjectLayer) "
  76. #else
  77. "(16-bit ObjectLayer) "
  78. #endif
  79. #ifdef JPH_ENABLE_ASSERTS
  80. "(Assertions) "
  81. #endif
  82. #ifdef JPH_OBJECT_STREAM
  83. "(ObjectStream) "
  84. #endif
  85. #ifdef JPH_DEBUG
  86. "(Debug) "
  87. #endif
  88. #if defined(__cpp_rtti) && __cpp_rtti
  89. "(C++ RTTI) "
  90. #endif
  91. #if defined(__cpp_exceptions) && __cpp_exceptions
  92. "(C++ Exceptions) "
  93. #endif
  94. ;
  95. }
  96. JPH_NAMESPACE_END