diff options
author | Brad King <brad.king@kitware.com> | 2022-08-09 13:16:34 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-08-09 13:16:42 (GMT) |
commit | 425f6a0ef6c3fd86d3ed5f12f03e68b01976f036 (patch) | |
tree | 102781ea7e5f3beceb24016ea18b48f95f301bcb | |
parent | 4be24f031a4829db75b85062cc67125035d8831e (diff) | |
parent | 720396378890ee93158343ff3d681423bf0bdd4a (diff) | |
download | CMake-425f6a0ef6c3fd86d3ed5f12f03e68b01976f036.zip CMake-425f6a0ef6c3fd86d3ed5f12f03e68b01976f036.tar.gz CMake-425f6a0ef6c3fd86d3ed5f12f03e68b01976f036.tar.bz2 |
Merge topic 'FindThreads-msvc-no-pthread-flag' into release-3.24
7203963788 FindThreads: Skip check for -pthread flag when targeting the MSVC ABI
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7551
-rw-r--r-- | Modules/FindThreads.cmake | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake index a2304c2..a675fd6 100644 --- a/Modules/FindThreads.cmake +++ b/Modules/FindThreads.cmake @@ -122,7 +122,11 @@ endmacro() macro(_threads_check_flag_pthread) if(NOT Threads_FOUND) # If we did not find -lpthreads, -lpthread, or -lthread, look for -pthread - if(NOT DEFINED THREADS_HAVE_PTHREAD_ARG) + # except on compilers known to not have it. + if(MSVC) + # Compilers targeting the MSVC ABI do not have a -pthread flag. + set(THREADS_HAVE_PTHREAD_ARG FALSE) + elseif(NOT DEFINED THREADS_HAVE_PTHREAD_ARG) message(CHECK_START "Check if compiler accepts -pthread") if(CMAKE_C_COMPILER_LOADED) set(_threads_src ${CMAKE_CURRENT_LIST_DIR}/CheckForPthreads.c) |