Merge pull request #1131 from djpohly/check-pthread-functions

CMake: check for timed pthreads functions
This commit is contained in:
Jason Felds
2016-06-02 06:56:32 -04:00
2 changed files with 9 additions and 0 deletions
+3
View File
@@ -231,6 +231,9 @@ find_package(Iconv)
find_package(Threads)
if (${Threads_FOUND})
set(HAS_PTHREAD TRUE)
list(APPEND CMAKE_REQUIRED_LIBRARIES pthread)
check_symbol_exists(pthread_mutex_timedlock pthread.h HAVE_PTHREAD_MUTEX_TIMEDLOCK)
check_symbol_exists(pthread_cond_timedwait pthread.h HAVE_PTHREAD_COND_TIMEDWAIT)
else()
set(HAS_PTHREAD FALSE)
endif()
+6
View File
@@ -93,6 +93,12 @@
/* Defined to 1 if the underlying system provides the posix_fadvise function. */
#cmakedefine HAVE_POSIX_FADVISE 1
/* Defined to 1 if the underlying system provides the pthread_mutex_timedlock function. */
#cmakedefine HAVE_PTHREAD_MUTEX_TIMEDLOCK 1
/* Defined to 1 if the underlying system provides the pthread_cond_timedwait function. */
#cmakedefine HAVE_PTHREAD_COND_TIMEDWAIT 1
/* Provide a fallback if intptr_t is not defined. */
#cmakedefine HAVE_SIZEOF_INTPTR_T 1
#if !defined(HAVE_SIZEOF_INTPTR_T)