CMake: Add check for Win SDK 10.0.18362.0 or above
The graphics capture changes require Windows SDK version 10.0.18362.0 or above to function, so check for that in CMake.
This commit is contained in:
parent
039c08144a
commit
cc5918fdb4
@ -11,6 +11,34 @@ option(BUILD_CAPTIONS "Build captions" FALSE)
|
||||
|
||||
if(WIN32)
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
# Check for Win SDK version 10.0.18362 or above
|
||||
if(MSVC AND MSVC_VERSION LESS 1920)
|
||||
message(STATUS "Windows API version is ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
|
||||
string(REPLACE "." ";" WINAPI_VER "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
|
||||
|
||||
list(GET WINAPI_VER 0 WINAPI_VER_MAJOR)
|
||||
list(GET WINAPI_VER 1 WINAPI_VER_MINOR)
|
||||
list(GET WINAPI_VER 2 WINAPI_VER_BUILD)
|
||||
|
||||
set(WINAPI_COMPATIBLE FALSE)
|
||||
if(WINAPI_VER_MAJOR EQUAL 10)
|
||||
if (WINAPI_VER_MINOR EQUAL 0)
|
||||
if (WINAPI_VER_BUILD GREATER_EQUAL 18362)
|
||||
set(WINAPI_COMPATIBLE TRUE)
|
||||
endif()
|
||||
else()
|
||||
set(WINAPI_COMPATIBLE TRUE)
|
||||
endif()
|
||||
elseif(WINAPI_VER_MAJOR GREATER 10)
|
||||
set(WINAPI_COMPATIBLE TRUE)
|
||||
endif()
|
||||
|
||||
if(NOT WINAPI_COMPATIBLE)
|
||||
message(FATAL_ERROR "OBS requires Windows 10 SDK version 10.0.18362.0 and above to compile.\nPlease download the most recent Windows 10 SDK in order to compile (or update to Visual Studio 2019).")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (QTDIR OR DEFINED ENV{QTDIR} OR DEFINED ENV{QTDIR32} OR DEFINED ENV{QTDIR64})
|
||||
# Qt path set by user or env var
|
||||
else()
|
||||
|
Loading…
x
Reference in New Issue
Block a user