Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CMake] Make the pybind11_*_proto_caster libraries STATIC
As pybind11 does not guarantee stable ABI for its types (e.g. pybind11::handle), these types have "hidden" visibility at least on Linux. This visibility is propagated to any method which has any of the pybind11 types in its parameters, which is the case for many of the public methods in proto_cast_util.{h,cc}. Trying to link to e.g. a SHARED pybind11_native_proto_caster library will create linker errors to to undefined symbols for any non-trivial case. The other approach would be to move everything which uses a pybind11 type to the headers, and only leave pybind11 agnostic methods in the shared library. While this is trivially possible for e.g. PyBytesAsStringView, for the majority of the methods (e.g. anything depending on the GlobalState object) a significant refactoring would be required. See pybind#160.
- Loading branch information