Poco.Foundation now links with pthreads on Unix platforms

Some of the libraries relies on functions from Poco.Foundation that
are implemented using pthreads and were leading to link errors.
This commit is contained in:
Mathäus Mendel 2016-03-11 10:14:43 -03:00
parent 6e5111d2ba
commit b245307780
3 changed files with 5 additions and 5 deletions

View File

@ -111,14 +111,14 @@ endif(ANDROID)
# TODO: Why is this here? # TODO: Why is this here?
add_definitions( -DPCRE_STATIC) add_definitions( -DPCRE_STATIC)
# For SetAffinity # For POSIX threads on Unix
if(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE)
# We still need pthreads on Unix
set(SYSLIBS ${SYSLIBS} ${CMAKE_THREAD_LIBS_INIT})
INCLUDE (CheckFunctionExists) INCLUDE (CheckFunctionExists)
INCLUDE (CheckCXXSourceCompiles) INCLUDE (CheckCXXSourceCompiles)
INCLUDE (CheckLibraryExists) INCLUDE (CheckLibraryExists)
CHECK_LIBRARY_EXISTS(pthread pthread_setaffinity_np "pthread.h" HAVE_PTHREAD_SETAFFINITY_NP) CHECK_LIBRARY_EXISTS(pthread pthread_setaffinity_np "pthread.h" HAVE_PTHREAD_SETAFFINITY_NP)
#set(CMAKE_EXTRA_INCLUDE_FILES pthread.h)
#CHECK_FUNCTION_EXISTS(pthread_setaffinity_np HAVE_PTHREAD_SETAFFINITY_NP)
if(NOT HAVE_PTHREAD_SETAFFINITY_NP) if(NOT HAVE_PTHREAD_SETAFFINITY_NP)
message(STATUS "Platform has not PTHREAD_SETAFFINITY_NP") message(STATUS "Platform has not PTHREAD_SETAFFINITY_NP")
else(HAVE_PTHREAD_SETAFFINITY_NP) else(HAVE_PTHREAD_SETAFFINITY_NP)

View File

@ -10,7 +10,7 @@ set_target_properties( "${POCO_EXENAME}"
OUTPUT_NAME cpspc OUTPUT_NAME cpspc
) )
target_link_libraries( "${POCO_EXENAME}" ${CMAKE_THREAD_LIBS_INIT} Net Util XML JSON Foundation) target_link_libraries( "${POCO_EXENAME}" Net Util XML JSON Foundation)
install( install(
TARGETS "${POCO_EXENAME}" EXPORT "${POCO_EXENAME}Targets" TARGETS "${POCO_EXENAME}" EXPORT "${POCO_EXENAME}Targets"

View File

@ -10,7 +10,7 @@ set_target_properties( "${POCO_EXENAME}"
OUTPUT_NAME f2cpsp OUTPUT_NAME f2cpsp
) )
target_link_libraries( "${POCO_EXENAME}" ${CMAKE_THREAD_LIBS_INIT} Net Util XML JSON Foundation) target_link_libraries( "${POCO_EXENAME}" Net Util XML JSON Foundation)
install( install(
TARGETS "${POCO_EXENAME}" EXPORT "${POCO_EXENAME}Targets" TARGETS "${POCO_EXENAME}" EXPORT "${POCO_EXENAME}Targets"