From a96fa4846dc2ebf008317206fa50a6c060a8b959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sat, 17 Sep 2022 16:43:30 -0700 Subject: [PATCH] Fixed windows sdk version selection. --- scripts/toolchain.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index 7c49fd8..445edab 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -185,9 +185,11 @@ function toolchain(_buildDir, _libDir) tvosPlatform = _OPTIONS["with-tvos"] end - local windowsPlatform = string.gsub(os.getenv("WindowsSDKVersion") or "8.1", "\\", "") + local windowsPlatform = nil if _OPTIONS["with-windows"] then windowsPlatform = _OPTIONS["with-windows"] + elseif nil ~= os.getenv("WindowsSDKVersion") then + windowsPlatform = string.gsub(os.getenv("WindowsSDKVersion"), "\\", "") end local compiler32bit = false @@ -411,8 +413,10 @@ function toolchain(_buildDir, _libDir) then local action = premake.action.current() - action.vstudio.windowsTargetPlatformVersion = windowsPlatform - action.vstudio.windowsTargetPlatformMinVersion = windowsPlatform + if nil ~= windowsPlatform then + action.vstudio.windowsTargetPlatformVersion = windowsPlatform + action.vstudio.windowsTargetPlatformMinVersion = windowsPlatform + end if (_ACTION .. "-clang") == _OPTIONS["vs"] then if "vs2017-clang" == _OPTIONS["vs"] then