From 4f6bedf6d990e67e769d7e9a1035b2073c3353ee Mon Sep 17 00:00:00 2001 From: Andy Walsh Date: Wed, 25 Jul 2018 12:41:43 +0200 Subject: [PATCH] cmake fix pthread detection * dont treat pthreads like a normal lib Signed-off-by: Andy Walsh --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 06d9c74d..02f4fed5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -128,7 +128,7 @@ if(UNIX) add_definitions(-DUNIX) - find_library(LIB_PTHREAD pthread) + find_package(Threads) find_library(LIB_READLINE readline) find_library(LIB_NCURSES ncurses) find_library(LIB_Z z) @@ -176,7 +176,7 @@ if(UNIX) endif() endif() -target_link_libraries(mayaqua ${LIB_PTHREAD} ${LIB_SSL} ${LIB_CRYPTO} ${LIB_READLINE} ${LIB_NCURSES} ${LIB_Z}) +target_link_libraries(mayaqua ${CMAKE_THREAD_LIBS_INIT} ${LIB_SSL} ${LIB_CRYPTO} ${LIB_READLINE} ${LIB_NCURSES} ${LIB_Z}) if(LIB_ICONV) target_link_libraries(mayaqua ${LIB_ICONV})