Browse Source

Fixed windows sdk version selection.

Бранимир Караџић 3 years ago
parent
commit
a96fa4846d
1 changed files with 7 additions and 3 deletions
  1. 7 3
      scripts/toolchain.lua

+ 7 - 3
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