From 7edeceec0376513002813efb7bf723fbcbe6752d Mon Sep 17 00:00:00 2001
From: Piraty <piraty1@inbox.ru>
Date: Fri, 15 Apr 2022 08:27:04 +0000
Subject: [PATCH] Link ykcore against pthread (#7807)

---
 src/thirdparty/ykcore/CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/thirdparty/ykcore/CMakeLists.txt b/src/thirdparty/ykcore/CMakeLists.txt
index 47191ea7..103349f2 100644
--- a/src/thirdparty/ykcore/CMakeLists.txt
+++ b/src/thirdparty/ykcore/CMakeLists.txt
@@ -27,13 +27,15 @@ if(WIN32)
 elseif(UNIX AND NOT APPLE)
     target_sources(ykcore PRIVATE ykcore_libusb-1.0.c)
 
+    find_package(Threads REQUIRED)
+
     find_library(LIBUSB_LIBRARY NAMES usb-1.0)
     find_path(LIBUSB_INCLUDE_DIR NAMES libusb.h PATH_SUFFIXES "libusb-1.0" "libusb")
     if(NOT LIBUSB_LIBRARY OR NOT LIBUSB_INCLUDE_DIR)
         message(FATAL_ERROR "libusb-1.0 dev package required, but not found")
     endif()
 
-    target_link_libraries(ykcore PRIVATE ${LIBUSB_LIBRARY})
+    target_link_libraries(ykcore PRIVATE Threads::Threads ${LIBUSB_LIBRARY})
     target_include_directories(ykcore PRIVATE ${LIBUSB_INCLUDE_DIR})
     target_compile_definitions(ykcore PRIVATE _GNU_SOURCE)
 elseif(APPLE)
-- 
2.35.1

