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:
Vadim Zeitlin
2026-04-07 23:21:56 +02:00
parent 459b007a80
commit 40a322946c
2 changed files with 22 additions and 1 deletions
+21
View File
@@ -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("
+1 -1
View File
@@ -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