@@ -74,13 +74,15 @@ removes this target from the default build (see CMake docs for details).
7474
7575Since pybind11 is a template library, ``pybind11_add_module `` adds compiler
7676flags to ensure high quality code generation without bloat arising from long
77- symbol names and duplication of code in different translation units. The
78- additional flags enable LTO (Link Time Optimization), set default visibility
79- to *hidden * and strip unneeded symbols. See the :ref: `FAQ entry <faq:symhidden >`
80- for a more detailed explanation. These optimizations are never applied in
81- ``Debug `` mode. If ``NO_EXTRAS `` is given, they will always be disabled, even
82- in ``Release `` mode. However, this will result in code bloat and is generally
83- not recommended.
77+ symbol names and duplication of code in different translation units. It
78+ sets default visibility to *hidden *, which is required for some pybind11
79+ features and functionality when attempting to load multiple pybind11 modules
80+ compiled under different pybind11 versions. It also adds additional flags
81+ enabling LTO (Link Time Optimization) and strip unneeded symbols. See the
82+ :ref: `FAQ entry <faq:symhidden >` for a more detailed explanation. These
83+ latter optimizations are never applied in ``Debug `` mode. If ``NO_EXTRAS `` is
84+ given, they will always be disabled, even in ``Release `` mode. However, this
85+ will result in code bloat and is generally not recommended.
8486
8587As stated above, LTO is enabled by default. Some newer compilers also support
8688different flavors of LTO such as `ThinLTO `_. Setting ``THIN_LTO `` will cause
@@ -181,9 +183,8 @@ to an independently constructed (through ``add_library``, not
181183 flags (i.e. this is up to you).
182184
183185 These include Link Time Optimization (``-flto `` on GCC/Clang/ICPC, ``/GL ``
184- and ``/LTCG `` on Visual Studio). Default-hidden symbols on GCC/Clang/ICPC
185- (``-fvisibility=hidden ``) and .OBJ files with many sections on Visual Studio
186- (``/bigobj ``). The :ref: `FAQ <faq:symhidden >` contains an
186+ and ``/LTCG `` on Visual Studio) and .OBJ files with many sections on Visual
187+ Studio (``/bigobj ``). The :ref: `FAQ <faq:symhidden >` contains an
187188 explanation on why these are needed.
188189
189190Embedding the Python interpreter
0 commit comments