Browse Source

Moved the definition of JPH_DOUBLE_PRECISION and JPH_CROSS_PLATFORM_DETERMINISTIC to Jolt.cmake to make them available through CMake fetch content (#420)

Jorrit Rouwe 2 years ago
parent
commit
e1e33ac424
2 changed files with 10 additions and 10 deletions
  1. 0 10
      Build/CMakeLists.txt
  2. 10 0
      Jolt/Jolt.cmake

+ 0 - 10
Build/CMakeLists.txt

@@ -48,11 +48,6 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}
 	set(CMAKE_CONFIGURATION_TYPES "Debug;Release;ReleaseASAN;ReleaseUBSAN;ReleaseCoverage;Distribution")
 endif()
 
-# Pass double precision flag on to the library
-if (DOUBLE_PRECISION)
-	add_compile_definitions(JPH_DOUBLE_PRECISION)
-endif()
-
 if (("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") AND NOT MINGW)
 	# Fill in the path to the asan libraries
 	set(CLANG_LIB_PATH "\"$(VSInstallDir)\\VC\\Tools\\Llvm\\x64\\lib\\clang\\${CMAKE_CXX_COMPILER_VERSION}\\lib\\windows\"")
@@ -234,11 +229,6 @@ elseif ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR "${CMAKE_SYSTEM_NAME}" STREQU
 	set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
 endif()
 
-# Setting to attempt cross platform determinism
-if (CROSS_PLATFORM_DETERMINISTIC)
-	add_compile_definitions(JPH_CROSS_PLATFORM_DETERMINISTIC)
-endif()
-
 set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF)
 set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_DISTRIBUTION OFF)
 

+ 10 - 0
Jolt/Jolt.cmake

@@ -423,3 +423,13 @@ 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>")
+
+# Setting double precision flag
+if (DOUBLE_PRECISION)
+	target_compile_definitions(Jolt PUBLIC JPH_DOUBLE_PRECISION)
+endif()
+
+# Setting to attempt cross platform determinism
+if (CROSS_PLATFORM_DETERMINISTIC)
+	target_compile_definitions(Jolt PUBLIC JPH_CROSS_PLATFORM_DETERMINISTIC)
+endif()