• Brad King's avatar
    FindProtobuf: Add missing link dependencies on threads · 03454b0d
    Brad King authored
    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 commit v3.9.0-rc1~81^2~2 (FindProtobuf: add targets,
    2017-05-17) and commit v3.9.0-rc1~68^2 (FindProtobuf: Rename imported
    targets to match upstream names, 2017-05-22) 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
    03454b0d
FindProtobuf.cmake 21.6 KB