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

[REQUEST] Support building without RTTI #1969

Open
hiokazaki opened this issue Nov 16, 2024 · 0 comments
Open

[REQUEST] Support building without RTTI #1969

hiokazaki opened this issue Nov 16, 2024 · 0 comments

Comments

@hiokazaki
Copy link

hiokazaki commented Nov 16, 2024

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

I'm using OpenVDB in a larger project that builds with -fno-rtti (no RTTI) as a matter of policy.

I noticed that OpenVDB uses RTTI for debug purposes. Actually, they mostly appear in the context of emitting failure messages before throwing an exception. I can't find any "geometric" use of RTTI in OpenVDB, which makes sense given the emphasis on high performance.

Describe the solution you'd like

It would be great if OpenVDB could have a new (cmake) configuration option added to build it without RTTI, and with more generic messages where RTTI is currently used. The changes to remove usage of RTTI from OpenVDB's C++ are trivial, but I am not familiar with CMake at all (except as a user) so I don't know how to make this change myself 😞

If it was preferred not to add any more configuration options, then I would request that debug builds of OpenVDB continue to use RTTI, but release builds do not (and provide more generic messages instead.)

Describe alternatives you've considered

A more aggressive option, but perhaps a simpler and easier one, would be to simply eliminate the few places where RTTI is used. In this way, no changes are required to the current configuration/build system. (To use OpenVDB without RTTI I made these changes myself and it works great. I would be happy to submit a pull request if desired.)

Another option would be to extend OpenVDB to carry the required type information internally to support a kind of "manual RTTI", but given how little use is made of RTTI currently (and probably in future) this seems very wasteful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant