From ba58bd973047f18aaa2d02371c3d38c541b13831 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 14 Feb 2025 08:17:32 +0100 Subject: [PATCH 1/2] Expose compiler define for JPH_FLOATING_POINT_EXCEPTIONS Signed-off-by: Uilian Ries --- recipes/joltphysics/5.x/conanfile.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/recipes/joltphysics/5.x/conanfile.py b/recipes/joltphysics/5.x/conanfile.py index c3253bb88163a..413d739a01a19 100644 --- a/recipes/joltphysics/5.x/conanfile.py +++ b/recipes/joltphysics/5.x/conanfile.py @@ -90,6 +90,11 @@ def package_info(self): self.cpp_info.defines.extend(["JPH_USE_AVX2", "JPH_USE_AVX", "JPH_USE_SSE4_1", "JPH_USE_SSE4_2", "JPH_USE_LZCNT", "JPH_USE_TZCNT", "JPH_USE_F16C", "JPH_USE_FMADD"]) + if is_msvc(self): + # INFO: Floating point exceptions are enabled by default + # https://github.com/jrouwe/JoltPhysics/blob/v5.2.0/Build/CMakeLists.txt#L37 + # https://github.com/jrouwe/JoltPhysics/blob/v5.2.0/Jolt/Jolt.cmake#L529 + self.cpp_info.defines.append("JPH_FLOATING_POINT_EXCEPTIONS_ENABLED") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("pthread") From 47616bbbd3acd19ee5bfe6852f96efccaa81225f Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 14 Feb 2025 08:54:44 +0100 Subject: [PATCH 2/2] Add more missing defines Signed-off-by: Uilian Ries --- recipes/joltphysics/5.x/conanfile.py | 8 ++++++++ recipes/joltphysics/5.x/test_package/test_package.cpp | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/recipes/joltphysics/5.x/conanfile.py b/recipes/joltphysics/5.x/conanfile.py index 413d739a01a19..0463e0d2c7a9d 100644 --- a/recipes/joltphysics/5.x/conanfile.py +++ b/recipes/joltphysics/5.x/conanfile.py @@ -96,5 +96,13 @@ def package_info(self): # https://github.com/jrouwe/JoltPhysics/blob/v5.2.0/Jolt/Jolt.cmake#L529 self.cpp_info.defines.append("JPH_FLOATING_POINT_EXCEPTIONS_ENABLED") + if self.options.shared: + # https://github.com/jrouwe/JoltPhysics/blob/v5.2.0/Jolt/Jolt.cmake#L495 + self.cpp_info.defines.append("JPH_SHARED_LIBRARY") + + # https://github.com/jrouwe/JoltPhysics/blob/v5.2.0/Build/CMakeLists.txt#L48 + # https://github.com/jrouwe/JoltPhysics/blob/v5.2.0/Jolt/Jolt.cmake#L554 + self.cpp_info.defines.append("JPH_OBJECT_LAYER_BITS=16") + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs.append("pthread") diff --git a/recipes/joltphysics/5.x/test_package/test_package.cpp b/recipes/joltphysics/5.x/test_package/test_package.cpp index 5f0927f9ae8d1..f37b8c6cafa56 100644 --- a/recipes/joltphysics/5.x/test_package/test_package.cpp +++ b/recipes/joltphysics/5.x/test_package/test_package.cpp @@ -1,8 +1,12 @@ #include #include +#include +#include int main() { JPH::RegisterDefaultAllocator(); + auto factory = JPH::Factory(); + JPH::UnregisterTypes(); return EXIT_SUCCESS; }