mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
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
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user