Parcourir la source

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
Brad King il y a 5 ans
Parent
commit
ae41216878
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      Modules/FindProtobuf.cmake

+ 1 - 1
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()