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

Added support for building on VS2012/13 targeting XP

Miodrag Milanovic пре 10 година
родитељ
комит
f57de3a154
2 измењених фајлова са 16 додато и 2 уклоњено
  1. 3 2
      include/bx/platform.h
  2. 13 0
      scripts/toolchain.lua

+ 3 - 2
include/bx/platform.h

@@ -125,9 +125,10 @@
 #	ifndef NOMINMAX
 #		define NOMINMAX
 #	endif // NOMINMAX
-#	if defined(_MSC_VER) && (_MSC_VER >= 1700)
+//  If _USING_V110_SDK71_ is defined it means we are using the v110_xp or v120_xp toolset.
+#	if defined(_MSC_VER) && (_MSC_VER >= 1700) && (!_USING_V110_SDK71_)
 #		include <winapifamily.h>
-#	endif // defined(_MSC_VER) && (_MSC_VER >= 1700)
+#	endif // defined(_MSC_VER) && (_MSC_VER >= 1700) && (!_USING_V110_SDK71_)
 #	if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
 #		undef  BX_PLATFORM_WINDOWS
 #		if !defined(WINVER) && !defined(_WIN32_WINNT)

+ 13 - 0
scripts/toolchain.lua

@@ -40,6 +40,8 @@ function toolchain(_buildDir, _libDir)
 		allowed = {
 			{ "vs2012-clang",  "Clang 3.6"         },
 			{ "vs2013-clang",  "Clang 3.6"         },
+			{ "vs2012-xp", 	   "Visual Studio 2012 targeting XP" },
+			{ "vs2013-xp", 	   "Visual Studio 2013 targeting XP" },
 			{ "winphone8",     "Windows Phone 8.0" },
 			{ "winphone81",    "Windows Phone 8.1" },
 		},
@@ -291,6 +293,17 @@ function toolchain(_buildDir, _libDir)
 			platforms { "ARM" }
 			location (path.join(_buildDir, "projects", _ACTION .. "-winphone81"))
 		end
+
+		if ("vs2012-xp") == _OPTIONS["vs"] then
+			premake.vstudio.toolset = ("v110_xp")
+			location (path.join(_buildDir, "projects", _ACTION .. "-xp"))
+		end
+		
+		if ("vs2013-xp") == _OPTIONS["vs"] then
+			premake.vstudio.toolset = ("v120_xp")
+			location (path.join(_buildDir, "projects", _ACTION .. "-xp"))
+		end
+		
 	elseif _ACTION == "xcode4" then
 
 		if "osx" == _OPTIONS["xcode"] then