diff options
author | Brad King <brad.king@kitware.com> | 2019-02-28 15:24:56 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-02-28 15:25:03 (GMT) |
commit | 8989fa255b7c4d1b9a7598eec29335801292e149 (patch) | |
tree | fb382614c7600aab1e46a6d49d1611079e593ec7 /Modules | |
parent | 0d9471fa2dee221aef8166ea370a98cc26d783e4 (diff) | |
parent | 18320230ecb273233b1ccb133537daf16179262c (diff) | |
download | CMake-8989fa255b7c4d1b9a7598eec29335801292e149.zip CMake-8989fa255b7c4d1b9a7598eec29335801292e149.tar.gz CMake-8989fa255b7c4d1b9a7598eec29335801292e149.tar.bz2 |
Merge topic 'FindThreads-revert-libc-check'
18320230ec FindThreads: Revert libc symbol check to pthread_create
e0267eb1d3 FindThreads: Fix libc check to use proper header for pthread_kill
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Rolf Eike Beer <eike@sf-mail.de>
Merge-request: !3022
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindThreads.cmake | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake index 5d894c8..919392a 100644 --- a/Modules/FindThreads.cmake +++ b/Modules/FindThreads.cmake @@ -118,16 +118,8 @@ if(CMAKE_HAVE_PTHREAD_H) set(CMAKE_HAVE_THREADS_LIBRARY) if(NOT THREADS_HAVE_PTHREAD_ARG) # Check if pthread functions are in normal C library. - # If the pthread functions already exist in C library, we could just use - # them instead of linking to the additional pthread library. We could - # try to check any pthread symbol name, but here is an exception. If we - # use clang asan build, we will find the pthread_create() symbol in the - # libc(libasan). However, it doesn't have the full pthread implementation. - # So, we can't assume that we have the pthread implementation in libc - # using the pthread_create() checking here. Then, we turn to check the - # pthread_kill() symbol instead. - CHECK_SYMBOL_EXISTS(pthread_kill pthread.h CMAKE_HAVE_LIBC_PTHREAD_KILL) - if(CMAKE_HAVE_LIBC_PTHREAD_KILL) + CHECK_SYMBOL_EXISTS(pthread_create pthread.h CMAKE_HAVE_LIBC_CREATE) + if(CMAKE_HAVE_LIBC_CREATE) set(CMAKE_THREAD_LIBS_INIT "") set(CMAKE_HAVE_THREADS_LIBRARY 1) set(Threads_FOUND TRUE) @@ -152,7 +144,7 @@ if(CMAKE_HAVE_PTHREAD_H) _check_pthreads_flag() endif() -if(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_PTHREAD_KILL) +if(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_CREATE) set(CMAKE_USE_PTHREADS_INIT 1) set(Threads_FOUND TRUE) endif() |