浏览代码

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

Ozkan Sezer 2 年之前
父节点
当前提交
1194f52a5c
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      cmake/sdlchecks.cmake

+ 4 - 0
cmake/sdlchecks.cmake

@@ -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)