Skip to content

FindProtobuf: Add missing link dependencies on threads

Brad King requested to merge brad.king/cmake:FindProtobuf-threads into master

Protobuf headers have dependencies on threads. On UNIX platforms this requires linking to a threads library. We've long done this in the Protobuf_LIBRARIES result variable. However, the imported targets added by !861 (merged) and !876 (merged) were missing a dependency on threads.

Add the dependency to the imported targets, and to the variables Protobuf_LITE_LIBRARIES and Protobuf_PROTOC_LIBRARIES. While this did not seem to matter in practice for a long time, protobuf 3.6 throws exceptions in some cases when threads are missing.

Fixes: #18533 (closed)

Merge request reports