From 1e50f1cb93344a29434ee49b95bea246e0bea452 Mon Sep 17 00:00:00 2001 From: SoftCoder Date: Mon, 2 Dec 2013 12:59:36 -0800 Subject: [PATCH] - updated vc++ 2010 build file to use git --- mk/windoze/build-mg-2010.bat | 39 ++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/mk/windoze/build-mg-2010.bat b/mk/windoze/build-mg-2010.bat index ec930069d..b0b581037 100644 --- a/mk/windoze/build-mg-2010.bat +++ b/mk/windoze/build-mg-2010.bat @@ -43,39 +43,44 @@ ECHO Setting up Visual Studio 2010 environment vars... REM Ensure ultifds HP doesn't mess the build up SET Platform= if "%DevEnvDir%." == "." goto SETVCVARS -GOTO SVNSECTION +GOTO GITSECTION :SETVCVARS IF EXIST "%VS100COMNTOOLS%..\..\" GOTO VC_Common IF EXIST "\Program Files\Microsoft Visual Studio 10.0\" GOTO VC_32 IF EXIST "\Program Files (x86)\Microsoft Visual Studio 10.0\" GOTO VC_64 -goto SVNSECTION +goto GITSECTION :VC_Common call "%VS100COMNTOOLS%..\..\vc\vcvarsall.bat" -goto SVNSECTION +goto GITSECTION :VC_32 ECHO 32 bit Windows detected... call "\Program Files\Microsoft Visual Studio 10.0\vc\vcvarsall.bat" -goto SVNSECTION +goto GITSECTION :VC_64 ECHO 64 bit Windows detected... call "\Program Files (x86)\Microsoft Visual Studio 10.0\vc\vcvarsall.bat" -goto SVNSECTION +goto GITSECTION -:SVNSECTION -rem Update from SVN to latest rev +:GITSECTION +rem Update from GIT to latest rev ECHO -------------------------------- -Echo Updating Code from SVN to latest Revision... -svn update ..\..\ +Echo Updating Code from GIT to latest Revision... +cd ..\..\ +git pull -set SVNVERSION=. -for /f "delims=" %%a in ('svnversion ..\..\ -n') do @set SVNVERSION=%%a -ECHO Will build using SVN Revision: [%SVNVERSION%] +set GITVERSION_SHA1=. +set GITVERSION_REV=. +set GET_GIT_SHA1="git log -1 --format=%%h" +for /f "delims=" %%a in ('%GET_GIT_SHA1%') do @set GITVERSION_SHA1=%%a +for /f "delims=" %%a in ('git rev-list HEAD --count') do @set GITVERSION_REV=%%a +ECHO Will build using GIT Revision: [%GITVERSION_REV%.%GITVERSION_SHA1%] +cd mk\windoze rem pause ECHO -------------------------------- @@ -88,12 +93,12 @@ ECHO -------------------------------- Echo Building Mega-Glest using Visual Studio 2010... set CL= -del ..\..\source\glest_game\facilities\svnversion.h +del ..\..\source\glest_game\facilities\gitversion.h -if not "%SVNVERSION%" == "." set CL=/DSVNVERSIONHEADER -if not "%SVNVERSION%" == "." echo building with CL [%CL%] -if not "%SVNVERSION%" == "." echo #define SVNVERSION "%SVNVERSION%" > ..\..\source\glest_game\facilities\svnversion.h -if not "%SVNVERSION%" == "." copy /b ..\..\source\glest_game\facilities\game_util.cpp +,, +if not "%GITVERSION_SHA1%" == "." set CL=/DGITVERSIONHEADER +if not "%GITVERSION_SHA1%" == "." echo building with CL [%CL%] +if not "%GITVERSION_SHA1%" == "." echo #define GITVERSION "%GITVERSION_REV%.%GITVERSION_SHA1%" > ..\..\source\glest_game\facilities\gitversion.h +if not "%GITVERSION_SHA1%" == "." copy /b ..\..\source\glest_game\facilities\game_util.cpp +,, set msBuildMaxCPU= SET BuildInParallel=false