From 12a76aec028281afcfb7014c959e5248bfa9ae46 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Fri, 20 Apr 2012 15:05:36 +0000 Subject: [PATCH] - small tweak to support multiple processors during build --- mk/windoze/build-mg-2010.bat | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/mk/windoze/build-mg-2010.bat b/mk/windoze/build-mg-2010.bat index cd1dc22a..96e33675 100644 --- a/mk/windoze/build-mg-2010.bat +++ b/mk/windoze/build-mg-2010.bat @@ -85,9 +85,19 @@ 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 +set msBuildMaxCPU= +SET BuildInParallel=false +if %NUMBER_OF_PROCESSORS% GTR 2 ( + SET NumberOfProcessesToUseForBuild=2 + SET BuildInParallel=true + SET msBuildMaxCPU=/maxcpucount:%NumberOfProcessesToUseForBuild%) + +ECHO Found CPU Count [%NUMBER_OF_PROCESSORS%] if "%2" == "rebuild" echo Doing a FULL REBUILD... -if "%2" == "rebuild" msbuild /p:Configuration=Release /t:Rebuild Glest_vc2010.sln -if not "%2" == "rebuild" msbuild /p:Configuration=Release Glest_vc2010.sln +rem if "%2" == "rebuild" msbuild /detailedsummary %msBuildMaxCPU% /p:BuildInParallel=%BuildInParallel% /p:Configuration=Release /t:Rebuild Glest_vc2010.sln +if "%2" == "rebuild" msbuild %msBuildMaxCPU% /p:Configuration=Release /t:Rebuild Glest_vc2010.sln +rem if not "%2" == "rebuild" msbuild /detailedsummary %msBuildMaxCPU% /p:BuildInParallel=%BuildInParallel% /p:Configuration=Release Glest_vc2010.sln +if not "%2" == "rebuild" msbuild %msBuildMaxCPU% /p:Configuration=Release Glest_vc2010.sln rem pause execution so we can see the output before the batch file exits if not "%1" == "nopause" pause