Merge pull request #1131 from djpohly/check-pthread-functions
CMake: check for timed pthreads functions
This commit is contained in:
@@ -231,6 +231,9 @@ find_package(Iconv)
|
|||||||
find_package(Threads)
|
find_package(Threads)
|
||||||
if (${Threads_FOUND})
|
if (${Threads_FOUND})
|
||||||
set(HAS_PTHREAD TRUE)
|
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()
|
else()
|
||||||
set(HAS_PTHREAD FALSE)
|
set(HAS_PTHREAD FALSE)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -93,6 +93,12 @@
|
|||||||
/* Defined to 1 if the underlying system provides the posix_fadvise function. */
|
/* Defined to 1 if the underlying system provides the posix_fadvise function. */
|
||||||
#cmakedefine HAVE_POSIX_FADVISE 1
|
#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. */
|
/* Provide a fallback if intptr_t is not defined. */
|
||||||
#cmakedefine HAVE_SIZEOF_INTPTR_T 1
|
#cmakedefine HAVE_SIZEOF_INTPTR_T 1
|
||||||
#if !defined(HAVE_SIZEOF_INTPTR_T)
|
#if !defined(HAVE_SIZEOF_INTPTR_T)
|
||||||
|
|||||||
Reference in New Issue
Block a user