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] Allow option to compile with rtti enabled, or make it default #42847

Open
mickeyordog opened this issue Dec 21, 2024 · 0 comments
Assignees
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist

Comments

@mickeyordog
Copy link

Is your feature request related to a problem? Please describe.

Yes, I am currently unable to compile my project with Jolt in its current state.

Proposed solution

See discussion with Jolt's owner here. His suggestion was to go here and "Just add something along the lines rtti_enabled CPP_RTTI_ENABLED to that code block." Alternatively the default could be changed to enable rtti.

Describe alternatives you've considered

No other alternatives while still using vcpkg

Additional context

Copy pasted from the thread with the owner:
Question: Hello, my project compiles fine when running the sample Hello World file, but I'm currently in the process of implementing a debug renderer and I'm getting the following error:

[build] Undefined symbols for architecture arm64:
[build]   "typeinfo for JPH::DebugRenderer", referenced from:
[build]       typeinfo for PhysicsDebugRenderer in libphysics.a[3](physicsDebugRenderer.cpp.o)
[build] ld: symbol(s) not found for architecture arm64

I'm using macOS Sonoma 14.4.1, in a VS Code project. Jolt is integrated via vcpkg/CMake with vcpkg install joltphysics[core,debugrenderer,profiler], so the debug renderer should be included there. I ran nm -gC path/to/libJolt.a | grep DebugRenderer and there were a lot of finds, maybe there's somehow no definition for it though. I'm not positive where to go from here. As mentioned, the default parts of the library are building and linking just fine.

Answer: Jolt by default compiles without C++ RTTI, your project is compiling with RTTI. Either turn it off for your own project or turn it on for Jolt using the CPP_RTTI_ENABLED cmake option.
I'm not the maintainer of the vcpkg, but looking at the vcpkg repository:

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
debugrenderer DEBUG_RENDERER_IN_DEBUG_AND_RELEASE
profiler PROFILER_IN_DEBUG_AND_RELEASE
)

it is not exposed.

Exposing it should be trivial though. Just add something along the lines rtti_enabled CPP_RTTI_ENABLED to that code block and send a PR to microsoft.

@mickeyordog mickeyordog added the category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist label Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist
Projects
None yet
Development

No branches or pull requests

2 participants