diff options
author | Brad King <brad.king@kitware.com> | 2020-09-22 12:25:51 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-09-22 12:49:22 (GMT) |
commit | ae412168782fec0dd6af92b983b7cfdc315077de (patch) | |
tree | 96f253cd1dc3c6701442699d4b02dcbab5587c79 /Modules | |
parent | 44c5f5d4ecbf0b11586ffd5abbc57375106b715e (diff) | |
download | CMake-ae412168782fec0dd6af92b983b7cfdc315077de.zip CMake-ae412168782fec0dd6af92b983b7cfdc315077de.tar.gz CMake-ae412168782fec0dd6af92b983b7cfdc315077de.tar.bz2 |
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')
-rw-r--r-- | Modules/FindProtobuf.cmake | 2 |
1 files changed, 1 insertions, 1 deletions
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() |