Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[joltphysics] Export missing compiler definitions #26594

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions recipes/joltphysics/5.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,19 @@ 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.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")
4 changes: 4 additions & 0 deletions recipes/joltphysics/5.x/test_package/test_package.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#include <cstdlib>
#include <Jolt/Jolt.h>
#include <Jolt/Core/Factory.h>
#include <Jolt/RegisterTypes.h>


int main() {
JPH::RegisterDefaultAllocator();
auto factory = JPH::Factory();
JPH::UnregisterTypes();
return EXIT_SUCCESS;
}