You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
message("Protobuf will be ${Protobuf_LIBRARIES} for PIC dynamic code and ${Protobuf_STATIC_LIBRARIES} for non-PIC static code")
FindProtobuf will find us debug versions of the Protobuf libraries, and they can be meaningfully different. We ought to pick the one to link based on whether the CMake build type is a debug one or not, so we can't end up with missing symbols, and so we don't cheat the one-definition rule and get (almost certainly benign) undefined behavior from the linker.
This would probably want to propagate up to vg and how its build process finds Protobuf to link against. We would also potentially have trouble if systems don't actually package a debug-mode Protobuf library. Also, the debug-mode Protobuf library is probably a lot slower, so it might be too slow for us to use, and we might not have a good solution other than trying to use the release library with an asserts-enabled vg application.
(An alternative would be to #define NDEBUG around all the Protobuf header includes in all the projects.)
The text was updated successfully, but these errors were encountered:
adamnovak
changed the title
We should like Protobuf release or debug libraries as appropriate to CMake build type
We should link Protobuf release or debug libraries as appropriate to CMake build type
Jul 22, 2022
We always link the main Protobuf libraries.
libvgio/CMakeLists.txt
Lines 26 to 27 in eb1fe76
FindProtobuf
will find us debug versions of the Protobuf libraries, and they can be meaningfully different. We ought to pick the one to link based on whether the CMake build type is a debug one or not, so we can't end up with missing symbols, and so we don't cheat the one-definition rule and get (almost certainly benign) undefined behavior from the linker.This would probably want to propagate up to vg and how its build process finds Protobuf to link against. We would also potentially have trouble if systems don't actually package a debug-mode Protobuf library. Also, the debug-mode Protobuf library is probably a lot slower, so it might be too slow for us to use, and we might not have a good solution other than trying to use the release library with an asserts-enabled vg application.
(An alternative would be to
#define NDEBUG
around all the Protobuf header includes in all the projects.)The text was updated successfully, but these errors were encountered: