Skip to content

Commit

Permalink
FAQ entry about RTTI/exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
wjakob committed Jan 6, 2025
1 parent fb81576 commit 698f449
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,24 @@ named domain to avoid conflicts with other extensions. To do so, specify the
In this case, inter-extension type visibility is furthermore restricted to
extensions in the ``"my_project"`` domain.

Can I use nanobind without RTTI or C++ exceptions?
--------------------------------------------------

Certain environments (e.g., `Google-internal development
<https://google.github.io/styleguide/cppguide.html>`__, embedded devices, etc.)
require compilation without C++ runtime type information (``-fno-rtti``) and
exceptions (``-fno-exceptions``).

nanobind requires both of these features and cannot be used when they are not
available. RTTI provides the central index to look up types of bindings.
Exceptions are needed because Python relies on exceptions that must be
converted into something equivalent on the C++ side. PRs that refactor nanobind
to work without RTTI or exceptions will not be accepted.

For Googlers: there is already an exemption from the internal rules that
specifically permits the use of RTTI/exceptions when a project relies on
pybind11. Likely, this exemption could be extended to include nanobind as well.

I'd like to use this project, but with $BUILD_SYSTEM instead of CMake
---------------------------------------------------------------------

Expand Down

0 comments on commit 698f449

Please sign in to comment.