|
@@ -489,17 +489,17 @@ endif()
|
|
|
|
|
|
target_include_directories(Jolt PUBLIC ${PHYSICS_REPO_ROOT})
|
|
|
target_precompile_headers(Jolt PRIVATE ${JOLT_PHYSICS_ROOT}/Jolt.h)
|
|
|
-target_compile_definitions(Jolt PUBLIC "$<$<CONFIG:Debug>:_DEBUG;JPH_PROFILE_ENABLED;JPH_DEBUG_RENDERER>")
|
|
|
-target_compile_definitions(Jolt PUBLIC "$<$<CONFIG:Release>:NDEBUG;JPH_PROFILE_ENABLED;JPH_DEBUG_RENDERER>")
|
|
|
-target_compile_definitions(Jolt PUBLIC "$<$<CONFIG:Distribution>:NDEBUG>")
|
|
|
-target_compile_definitions(Jolt PUBLIC "$<$<CONFIG:ReleaseASAN>:NDEBUG;JPH_PROFILE_ENABLED;JPH_DISABLE_TEMP_ALLOCATOR;JPH_DISABLE_CUSTOM_ALLOCATOR;JPH_DEBUG_RENDERER>")
|
|
|
-target_compile_definitions(Jolt PUBLIC "$<$<CONFIG:ReleaseUBSAN>:NDEBUG;JPH_PROFILE_ENABLED;JPH_DEBUG_RENDERER>")
|
|
|
-target_compile_definitions(Jolt PUBLIC "$<$<CONFIG:ReleaseCoverage>:NDEBUG>")
|
|
|
+
|
|
|
+# Set the debug/non-debug build flags
|
|
|
+target_compile_definitions(Jolt PUBLIC "$<$<CONFIG:Debug>:_DEBUG>")
|
|
|
+target_compile_definitions(Jolt PUBLIC "$<$<CONFIG:Release,Distribution,ReleaseASAN,ReleaseUBSAN,ReleaseCoverage>:NDEBUG>")
|
|
|
+
|
|
|
+# ASAN should use the default allocators
|
|
|
+target_compile_definitions(Jolt PUBLIC "$<$<CONFIG:ReleaseASAN>:JPH_DISABLE_TEMP_ALLOCATOR;JPH_DISABLE_CUSTOM_ALLOCATOR>")
|
|
|
|
|
|
# Setting floating point exceptions
|
|
|
if (FLOATING_POINT_EXCEPTIONS_ENABLED AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
|
|
- target_compile_definitions(Jolt PUBLIC "$<$<CONFIG:Debug>:JPH_FLOATING_POINT_EXCEPTIONS_ENABLED>")
|
|
|
- target_compile_definitions(Jolt PUBLIC "$<$<CONFIG:Release>:JPH_FLOATING_POINT_EXCEPTIONS_ENABLED>")
|
|
|
+ target_compile_definitions(Jolt PUBLIC "$<$<CONFIG:Debug,Release>:JPH_FLOATING_POINT_EXCEPTIONS_ENABLED>")
|
|
|
endif()
|
|
|
|
|
|
# Setting the disable custom allocator flag
|
|
@@ -532,10 +532,18 @@ if (TRACK_NARROWPHASE_STATS)
|
|
|
target_compile_definitions(Jolt PUBLIC JPH_TRACK_NARROWPHASE_STATS)
|
|
|
endif()
|
|
|
|
|
|
-# Setting to enable the debug renderer. The debug renderer is enabled by default with Debug and Release builds.
|
|
|
-# Note that enabling this reduces the performance of the library even if you're not drawing anything.
|
|
|
+# Enable the debug renderer
|
|
|
if (DEBUG_RENDERER_IN_DISTRIBUTION)
|
|
|
- target_compile_definitions(Jolt PUBLIC "$<$<CONFIG:Distribution>:JPH_DEBUG_RENDERER>")
|
|
|
+ target_compile_definitions(Jolt PUBLIC "JPH_DEBUG_RENDERER")
|
|
|
+elseif (DEBUG_RENDERER_IN_DEBUG_AND_RELEASE)
|
|
|
+ target_compile_definitions(Jolt PUBLIC "$<$<CONFIG:Debug,Release,ReleaseASAN,ReleaseUBSAN>:JPH_DEBUG_RENDERER>")
|
|
|
+endif()
|
|
|
+
|
|
|
+# Enable the profiler
|
|
|
+if (PROFILER_IN_DISTRIBUTION)
|
|
|
+ target_compile_definitions(Jolt PUBLIC "JPH_PROFILE_ENABLED")
|
|
|
+elseif (PROFILER_IN_DEBUG_AND_RELEASE)
|
|
|
+ target_compile_definitions(Jolt PUBLIC "$<$<CONFIG:Debug,Release,ReleaseASAN,ReleaseUBSAN>:JPH_PROFILE_ENABLED>")
|
|
|
endif()
|
|
|
|
|
|
# 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)
|