From 3bccf4d977faf399475ae455707bb526bdba7287 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Sat, 9 Jun 2012 18:02:35 -0400 Subject: [PATCH] Explicitly link to pthreads, seems some systems need this #47 --- CMakeLists.txt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5cefd5e..b0ffc54 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,19 +86,24 @@ if (MULTITHREAD_SUPPORT_ENABLED) else() message(FATAL_ERROR "Can not find Boost") endif(Boost_FOUND) + + if (CMAKE_HOST_UNIX) + add_definitions(-pthread) + list(APPEND LIBS "pthread") + endif() else() add_definitions(-DCHAISCRIPT_NO_THREADS) endif() if (CMAKE_HOST_UNIX) - set(DYNAMIC_LOADER "dl") + list(APPEND LIBS "dl") endif(CMAKE_HOST_UNIX) + +list(APPEND LIBS ${READLINE_LIB}) -if (MSVC) +if (NOT MSVC) # Boost on MSVC does automatic linking - set(LIBS ${DYNAMIC_LOADER} ${READLINE_LIB}) -else() - set(LIBS ${DYNAMIC_LOADER} ${Boost_LIBRARIES} ${READLINE_LIB}) + list(APPEND LIBS ${Boost_LIBRARIES}) endif() if (CMAKE_COMPILER_2005)