From 010b472f69df675fbe7c3770105fb3033ef038c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Fri, 14 Apr 2017 21:24:55 -0700 Subject: [PATCH] Updated toolchain for specifying Windows SDK version. Issue #147. --- scripts/toolchain.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index cec1a3d..f196cf4 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -135,7 +135,7 @@ function toolchain(_buildDir, _libDir) newoption { trigger = "with-windows", value = "#", - description = "Set the Windows target platform version (default: 10.0.10240.0).", + description = "Set the Windows target platform version (default: $WindowsSDKVersion or 8.1).", } newoption { @@ -179,7 +179,7 @@ function toolchain(_buildDir, _libDir) tvosPlatform = _OPTIONS["with-tvos"] end - local windowsPlatform = "10.0.10240.0" + local windowsPlatform = os.getenv("WindowsSDKVersion") or "8.1" if _OPTIONS["with-windows"] then windowsPlatform = _OPTIONS["with-windows"] end @@ -458,6 +458,10 @@ function toolchain(_buildDir, _libDir) or _ACTION == "vs2017" then + local action = premake.action.current() + action.vstudio.windowsTargetPlatformVersion = windowsPlatform + action.vstudio.windowsTargetPlatformMinVersion = windowsPlatform + if (_ACTION .. "-clang") == _OPTIONS["vs"] then if "vs2017-clang" == _OPTIONS["vs"] then premake.vstudio.toolset = "v141_clang_c2" @@ -488,10 +492,6 @@ function toolchain(_buildDir, _libDir) premake.vstudio.toolset = "v140" premake.vstudio.storeapp = "8.2" - local action = premake.action.current() - action.vstudio.windowsTargetPlatformVersion = windowsPlatform - action.vstudio.windowsTargetPlatformMinVersion = windowsPlatform - platforms { "ARM" } location (path.join(_buildDir, "projects", _ACTION .. "-winstore82"))