summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-08-09 13:16:34 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-08-09 13:16:43 (GMT)
commit8100f117139560c8a825e37b3b070245bcf2e90b (patch)
tree500b0c15e86d57e58d8adad7742e8080a0554f7d /Modules
parent241fc839d56ccd666fe41269e291b8d8190cf97b (diff)
parent720396378890ee93158343ff3d681423bf0bdd4a (diff)
downloadCMake-8100f117139560c8a825e37b3b070245bcf2e90b.zip
CMake-8100f117139560c8a825e37b3b070245bcf2e90b.tar.gz
CMake-8100f117139560c8a825e37b3b070245bcf2e90b.tar.bz2
Merge topic 'FindThreads-msvc-no-pthread-flag'
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
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindThreads.cmake6
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)