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:43 (GMT) |
commit | 8100f117139560c8a825e37b3b070245bcf2e90b (patch) | |
tree | 500b0c15e86d57e58d8adad7742e8080a0554f7d /Modules | |
parent | 241fc839d56ccd666fe41269e291b8d8190cf97b (diff) | |
parent | 720396378890ee93158343ff3d681423bf0bdd4a (diff) | |
download | CMake-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.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) |