From ae412168782fec0dd6af92b983b7cfdc315077de Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 22 Sep 2020 08:25:51 -0400 Subject: FindProtobuf: Link to threads dependency only when Protobuf is found Since commit 03454b0d0d (FindProtobuf: Add missing link dependencies on threads, 2018-10-31, v3.13.0-rc3~10^2) we add the threads library to the list of libraries needed for Protobuf. Update the logic to do this only when a real protobuf library is actually found. Fixes: #21161 --- Modules/FindProtobuf.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake index f6d8fe3..4bf54ef 100644 --- a/Modules/FindProtobuf.cmake +++ b/Modules/FindProtobuf.cmake @@ -388,7 +388,7 @@ function(_protobuf_find_libraries name filename) select_library_configurations(${name}) - if(UNIX AND Threads_FOUND) + if(UNIX AND Threads_FOUND AND ${name}_LIBRARY) list(APPEND ${name}_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) endif() -- cgit v0.12