summaryrefslogtreecommitdiff
path: root/Modules/FindProtobuf.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-09-22 08:25:51 -0400
committerBrad King <brad.king@kitware.com>2020-09-22 08:49:22 -0400
commitae412168782fec0dd6af92b983b7cfdc315077de (patch)
tree96f253cd1dc3c6701442699d4b02dcbab5587c79 /Modules/FindProtobuf.cmake
parent44c5f5d4ecbf0b11586ffd5abbc57375106b715e (diff)
downloadcmake-ae412168782fec0dd6af92b983b7cfdc315077de.tar.gz
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
Diffstat (limited to 'Modules/FindProtobuf.cmake')
-rw-r--r--Modules/FindProtobuf.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index f6d8fe3100..4bf54efe3c 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()