Преглед изворни кода

Updated toolchain for specifying Windows SDK version. Issue #147.

Branimir Karadžić пре 8 година
родитељ
комит
010b472f69
1 измењених фајлова са 6 додато и 6 уклоњено
  1. 6 6
      scripts/toolchain.lua

+ 6 - 6
scripts/toolchain.lua

@@ -135,7 +135,7 @@ function toolchain(_buildDir, _libDir)
 	newoption {
 	newoption {
 		trigger = "with-windows",
 		trigger = "with-windows",
 		value = "#",
 		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 {
 	newoption {
@@ -179,7 +179,7 @@ function toolchain(_buildDir, _libDir)
 		tvosPlatform = _OPTIONS["with-tvos"]
 		tvosPlatform = _OPTIONS["with-tvos"]
 	end
 	end
 
 
-	local windowsPlatform = "10.0.10240.0"
+	local windowsPlatform = os.getenv("WindowsSDKVersion") or "8.1"
 	if _OPTIONS["with-windows"] then
 	if _OPTIONS["with-windows"] then
 		windowsPlatform = _OPTIONS["with-windows"]
 		windowsPlatform = _OPTIONS["with-windows"]
 	end
 	end
@@ -458,6 +458,10 @@ function toolchain(_buildDir, _libDir)
 		or _ACTION == "vs2017"
 		or _ACTION == "vs2017"
 		then
 		then
 
 
+		local action = premake.action.current()
+		action.vstudio.windowsTargetPlatformVersion    = windowsPlatform
+		action.vstudio.windowsTargetPlatformMinVersion = windowsPlatform
+
 		if (_ACTION .. "-clang") == _OPTIONS["vs"] then
 		if (_ACTION .. "-clang") == _OPTIONS["vs"] then
 			if "vs2017-clang" == _OPTIONS["vs"] then
 			if "vs2017-clang" == _OPTIONS["vs"] then
 				premake.vstudio.toolset = "v141_clang_c2"
 				premake.vstudio.toolset = "v141_clang_c2"
@@ -488,10 +492,6 @@ function toolchain(_buildDir, _libDir)
 			premake.vstudio.toolset = "v140"
 			premake.vstudio.toolset = "v140"
 			premake.vstudio.storeapp = "8.2"
 			premake.vstudio.storeapp = "8.2"
 
 
-			local action = premake.action.current()
-			action.vstudio.windowsTargetPlatformVersion = windowsPlatform
-			action.vstudio.windowsTargetPlatformMinVersion = windowsPlatform
-
 			platforms { "ARM" }
 			platforms { "ARM" }
 			location (path.join(_buildDir, "projects", _ACTION .. "-winstore82"))
 			location (path.join(_buildDir, "projects", _ACTION .. "-winstore82"))