aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRechi <Rechi@users.noreply.github.com>2018-02-25 18:00:00 +0100
committerRechi <Rechi@users.noreply.github.com>2018-02-25 18:00:00 +0100
commitd8d210865da78ce3f17d0cdc3a615e78f582b37d (patch)
tree773c53453ddf8f584b067fe325968c5a68e1a764
parent1ed83d8293cfd12dece2e341f0b74ebb0dff16cb (diff)
[cmake][windows] require SDK 10.0.14393.0 or higher
-rw-r--r--cmake/scripts/windows/ArchSetup.cmake9
-rw-r--r--cmake/scripts/windowsstore/ArchSetup.cmake12
2 files changed, 18 insertions, 3 deletions
diff --git a/cmake/scripts/windows/ArchSetup.cmake b/cmake/scripts/windows/ArchSetup.cmake
index ddac940a03..b3963a6e6e 100644
--- a/cmake/scripts/windows/ArchSetup.cmake
+++ b/cmake/scripts/windows/ArchSetup.cmake
@@ -1,3 +1,12 @@
+# Minimum SDK version we support
+set(VS_MINIMUM_SDK_VERSION 10.0.14393.0)
+
+if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION VERSION_LESS VS_MINIMUM_SDK_VERSION)
+ message(FATAL_ERROR "Detected Windows SDK version is ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}.\n"
+ "Windows SDK ${VS_MINIMUM_SDK_VERSION} or higher is required.\n"
+ "INFO: Windows SDKs can be installed from the Visual Studio installer.")
+endif()
+
# -------- Architecture settings ---------
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
diff --git a/cmake/scripts/windowsstore/ArchSetup.cmake b/cmake/scripts/windowsstore/ArchSetup.cmake
index f533be8a57..a663bb9962 100644
--- a/cmake/scripts/windowsstore/ArchSetup.cmake
+++ b/cmake/scripts/windowsstore/ArchSetup.cmake
@@ -1,3 +1,12 @@
+# Minimum SDK version we support
+set(VS_MINIMUM_SDK_VERSION 10.0.14393.0)
+
+if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION VERSION_LESS VS_MINIMUM_SDK_VERSION)
+ message(FATAL_ERROR "Detected Windows SDK version is ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}.\n"
+ "Windows SDK ${VS_MINIMUM_SDK_VERSION} or higher is required.\n"
+ "INFO: Windows SDKs can be installed from the Visual Studio installer.")
+endif()
+
# -------- Architecture settings ---------
check_symbol_exists(_X86_ "Windows.h" _X86_)
@@ -103,9 +112,6 @@ set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OP
# remove warning
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4264")
-# Minimum SDK version we support
-set(VS_MINIMUM_SDK_VERSION 10.0.14393.0)
-
# -------- Visual Studio options ---------