cmake: fix detection of pthread_setname_np() on Apple platforms.

This commit is contained in:
Ozkan Sezer 2023-02-13 11:55:40 +03:00
parent 45e5f0f10b
commit 1194f52a5c

View file

@ -1019,7 +1019,11 @@ macro(CheckPTHREAD)
check_c_source_compiles("
#include <pthread.h>
int main(int argc, char **argv) {
#ifdef __APPLE__
pthread_setname_np(pthread_self());
#else
pthread_setname_np(pthread_self(), \"\");
#endif
return 0;
}" HAVE_PTHREAD_SETNAME_NP)
if (HAVE_PTHREAD_NP_H)