From 80b85cd384cc05052f7e64547e64c67ac3263ac9 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Sat, 18 Sep 2021 13:16:39 +0600 Subject: [PATCH] Fix linking with pthreads on Windows --- src/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c0be6a5cb..08b441d3e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -48,7 +48,11 @@ if(NOT WIN32 OR PTHREAD) target_sources(86Box PRIVATE thread.c) if(WIN32 AND VCPKG_TOOLCHAIN) find_package(pthreads REQUIRED) - target_link_libraries(86Box pthreads) + if (PThreads4W_FOUND) + target_link_libraries(86Box PThreads4W::PThreads4W) + else() + target_link_libraries(86Box pthreads) + endif() else() set(THREADS_PREFER_PTHREAD_FLAG TRUE) find_package(Threads REQUIRED)