CMakeLists.txt: Check the Windows SDK version (#2729)

This commit is contained in:
Stephan T. Lavavej 2022-05-23 17:57:01 -07:00 коммит произвёл GitHub
Родитель 296681379d
Коммит dae60920e9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -5,6 +5,16 @@ cmake_minimum_required(VERSION 3.22)
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
project(msvc_standard_libraries LANGUAGES CXX) project(msvc_standard_libraries LANGUAGES CXX)
include(CheckCXXSourceCompiles)
check_cxx_source_compiles([=[
#include <sdkddkver.h>
static_assert(WDK_NTDDI_VERSION >= NTDDI_WIN10_CO, "Inspecting WDK_NTDDI_VERSION, the Windows SDK version.");
int main() {}
]=] WINDOWS_SDK_VERSION_CHECK)
if(NOT WINDOWS_SDK_VERSION_CHECK)
message(FATAL_ERROR "The STL must be built with the Windows 11 SDK (10.0.22000.0) or later. Make sure it's available by selecting it in the Individual Components tab of the VS Installer.")
endif()
# add the tools subdirectory _before_ we change all the flags # add the tools subdirectory _before_ we change all the flags
add_subdirectory(tools EXCLUDE_FROM_ALL) add_subdirectory(tools EXCLUDE_FROM_ALL)
# these allow the targets to show up in the top-level # these allow the targets to show up in the top-level