Explicitly link to pthreads, seems some systems need this #47

This commit is contained in:
Jason Turner
2012-06-09 18:02:35 -04:00
parent d2aba2ef56
commit 3bccf4d977

View File

@@ -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)
if (MSVC)
list(APPEND LIBS ${READLINE_LIB})
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)