Browse Source

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

Ozkan Sezer 2 năm trước cách đây
mục cha
commit
1194f52a5c
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      cmake/sdlchecks.cmake

+ 4 - 0
cmake/sdlchecks.cmake

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