mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-01 11:50:11 -05:00
FindThreads: Simplify conditions for not-in-libc checks
If `CMAKE_HAVE_LIBC_PTHREAD` is true, we also set `Threads_FOUND` to true, which blocks all the other checks from running.
This commit is contained in:
+13
-13
@@ -165,21 +165,21 @@ if(CMAKE_HAVE_PTHREAD_H)
|
|||||||
if(CMAKE_HAVE_LIBC_PTHREAD)
|
if(CMAKE_HAVE_LIBC_PTHREAD)
|
||||||
set(CMAKE_THREAD_LIBS_INIT "")
|
set(CMAKE_THREAD_LIBS_INIT "")
|
||||||
set(Threads_FOUND TRUE)
|
set(Threads_FOUND TRUE)
|
||||||
else()
|
|
||||||
# Check for -pthread first if enabled. This is the recommended
|
|
||||||
# way, but not backwards compatible as one must also pass -pthread
|
|
||||||
# as compiler flag then.
|
|
||||||
if (THREADS_PREFER_PTHREAD_FLAG)
|
|
||||||
_threads_check_flag_pthread()
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
if(CMAKE_SYSTEM MATCHES "GHS-MULTI")
|
|
||||||
_threads_check_lib(posix pthread_create CMAKE_HAVE_PTHREADS_CREATE)
|
|
||||||
endif()
|
|
||||||
_threads_check_lib(pthreads pthread_create CMAKE_HAVE_PTHREADS_CREATE)
|
|
||||||
_threads_check_lib(pthread pthread_create CMAKE_HAVE_PTHREAD_CREATE)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Check for -pthread first if enabled. This is the recommended
|
||||||
|
# way, but not backwards compatible as one must also pass -pthread
|
||||||
|
# as compiler flag then.
|
||||||
|
if (THREADS_PREFER_PTHREAD_FLAG)
|
||||||
|
_threads_check_flag_pthread()
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM MATCHES "GHS-MULTI")
|
||||||
|
_threads_check_lib(posix pthread_create CMAKE_HAVE_PTHREADS_CREATE)
|
||||||
|
endif()
|
||||||
|
_threads_check_lib(pthreads pthread_create CMAKE_HAVE_PTHREADS_CREATE)
|
||||||
|
_threads_check_lib(pthread pthread_create CMAKE_HAVE_PTHREAD_CREATE)
|
||||||
|
|
||||||
_threads_check_flag_pthread()
|
_threads_check_flag_pthread()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user