cmake: Fix broken pthread detection on Windows with CMake 3.24

Workaround for CMake issue
https://gitlab.kitware.com/cmake/cmake/-/issues/23829
master
PatTheMav 2022-08-08 14:39:51 +02:00 committed by Jim
parent 9c77796299
commit 61f862d826
1 changed files with 6 additions and 0 deletions

View File

@ -15,6 +15,12 @@ if(OS_WINDOWS AND MSVC)
)
endif()
# CMake 3.24 introduces a bug mistakenly interpreting MSVC as supporting
# `-pthread`
if(${CMAKE_VERSION} VERSION_EQUAL "3.24.0")
set(THREADS_HAVE_PTHREAD_ARG OFF)
endif()
# Check for Win SDK version 10.0.20348 or above
obs_status(
STATUS "Windows API version is ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")