mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-26 01:28:38 +08:00
Check for a bunch of thread-related functions in CMake too
For some reason we never checked for them and so never defined the corresponding symbols. Also fix HAVE_PTHREAD_SETCONCURRENCY spelling in CMake setup.h which had an extra underscore.
This commit is contained in:
@@ -401,6 +401,27 @@ if(UNIX)
|
||||
endif(UNIX)
|
||||
|
||||
if(CMAKE_USE_PTHREADS_INIT)
|
||||
wx_check_funcs(
|
||||
pthread_attr_setstacksize
|
||||
pthread_cancel
|
||||
pthread_mutex_timedlock
|
||||
pthread_setconcurrency
|
||||
sched_yield
|
||||
)
|
||||
|
||||
wx_check_funcs(pthread_attr_getschedpolicy)
|
||||
if(HAVE_PTHREAD_ATTR_GETSCHEDPOLICY)
|
||||
wx_check_funcs(pthread_attr_setschedparam)
|
||||
if(HAVE_PTHREAD_ATTR_SETSCHEDPARAM)
|
||||
wx_check_funcs(sched_get_priority_max)
|
||||
if(HAVE_SCHED_GET_PRIORITY_MAX)
|
||||
set(HAVE_THREAD_PRIORITY_FUNCTIONS 1)
|
||||
else()
|
||||
message(WARNING "Setting thread priority will not work")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
cmake_push_check_state(RESET)
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
||||
wx_check_cxx_source_compiles("
|
||||
|
||||
@@ -1026,7 +1026,7 @@
|
||||
#cmakedefine HAVE_THR_SETCONCURRENCY 1
|
||||
|
||||
/* Define if you have pthread_setconcurrency function */
|
||||
#cmakedefine HAVE_PTHREAD_SET_CONCURRENCY 1
|
||||
#cmakedefine HAVE_PTHREAD_SETCONCURRENCY 1
|
||||
|
||||
/* Define if you have the uname function. */
|
||||
#cmakedefine HAVE_UNAME 1
|
||||
|
||||
Reference in New Issue
Block a user