From bbb936df0fd75bea41a00113a8ac4c4a281e970f Mon Sep 17 00:00:00 2001 From: warptangent Date: Thu, 16 Jul 2015 05:18:15 -0700 Subject: [PATCH] Use g++ flag "-pthread" instead of "-lpthread", where preferred CMake supports this through THREADS_PREFER_PTHREAD_FLAG. Remove inclusion of pthread library in EXTRA_LIBRARIES, as the individual CMakeLists.txt files which need pthread already require it with CMAKE_THREAD_LIBS_INIT. --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ccb4133..3e7378a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -230,6 +230,7 @@ add_definitions("-DBLOCKCHAIN_DB=${BLOCKCHAIN_DB}") if (UNIX AND NOT APPLE) # Note that at the time of this writing the -Wstrict-prototypes flag added below will make this fail + set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads) endif() @@ -410,7 +411,7 @@ elseif(APPLE OR FREEBSD) set(EXTRA_LIBRARIES "") elseif(NOT MSVC) find_library(RT rt) - set(EXTRA_LIBRARIES ${RT} ${PTHREAD} ${DL}) + set(EXTRA_LIBRARIES ${RT} ${DL}) endif() include(version.cmake)