blob: 2846144ff98028b6a725bd97bae14ba8e8dc1fb8 [file] [log] [blame]
Christian Heimes4a7cae52007-11-08 23:55:45 +00001@echo off
Zachary Waree12fa652014-07-07 13:39:59 -05002rem A batch program to build or rebuild a particular configuration,
Christian Heimes5b5e81c2007-12-31 16:14:33 +00003rem just for convenience.
4
Zachary Waree12fa652014-07-07 13:39:59 -05005rem Arguments:
6rem -c Set the configuration (default: Release)
7rem -p Set the platform (x64 or Win32, default: Win32)
8rem -r Target Rebuild instead of Build
Steve Dower65e4cb12014-11-22 12:54:57 -08009rem -t Set the target manually (Build, Rebuild, Clean, or CleanAll)
Zachary Waree12fa652014-07-07 13:39:59 -050010rem -d Set the configuration to Debug
11rem -e Pull in external libraries using get_externals.bat
Steve Dower65e4cb12014-11-22 12:54:57 -080012rem -M Disable parallel build
13rem -v Increased output messages
Zachary Waree12fa652014-07-07 13:39:59 -050014
Christian Heimes4a7cae52007-11-08 23:55:45 +000015setlocal
Christian Heimes5b5e81c2007-12-31 16:14:33 +000016set platf=Win32
Steve Dower65e4cb12014-11-22 12:54:57 -080017set vs_platf=x86
Christian Heimes5b5e81c2007-12-31 16:14:33 +000018set conf=Release
Zachary Waree12fa652014-07-07 13:39:59 -050019set target=Build
Brian Curtin5c2725d2012-05-22 11:04:32 -050020set dir=%~dp0
Steve Dower65e4cb12014-11-22 12:54:57 -080021set parallel=/m
22set verbose=/nologo /v:m
Christian Heimes4a7cae52007-11-08 23:55:45 +000023
Christian Heimes5b5e81c2007-12-31 16:14:33 +000024:CheckOpts
Zachary Warec6f8c0a2014-07-31 23:58:27 -050025if '%1'=='-c' (set conf=%2) & shift & shift & goto CheckOpts
26if '%1'=='-p' (set platf=%2) & shift & shift & goto CheckOpts
27if '%1'=='-r' (set target=Rebuild) & shift & goto CheckOpts
Steve Dower65e4cb12014-11-22 12:54:57 -080028if '%1'=='-t' (set target=%2) & shift & shift & goto CheckOpts
Zachary Warec6f8c0a2014-07-31 23:58:27 -050029if '%1'=='-d' (set conf=Debug) & shift & goto CheckOpts
30if '%1'=='-e' call "%dir%get_externals.bat" & shift & goto CheckOpts
Steve Dower65e4cb12014-11-22 12:54:57 -080031if '%1'=='-M' (set parallel=) & shift & goto CheckOpts
32if '%1'=='-v' (set verbose=/v:n) & shift & goto CheckOpts
Christian Heimes4a7cae52007-11-08 23:55:45 +000033
Zachary Warec6f8c0a2014-07-31 23:58:27 -050034if '%platf%'=='x64' (set vs_platf=x86_amd64)
Zachary Waree12fa652014-07-07 13:39:59 -050035
36rem Setup the environment
Steve Dower65e4cb12014-11-22 12:54:57 -080037call "%dir%env.bat" %vs_platf% >nul
Zachary Waree12fa652014-07-07 13:39:59 -050038
39rem Call on MSBuild to do the work, echo the command.
40rem Passing %1-9 is not the preferred option, but argument parsing in
41rem batch is, shall we say, "lackluster"
42echo on
Steve Dower65e4cb12014-11-22 12:54:57 -080043msbuild "%dir%pcbuild.proj" /t:%target% %parallel% %verbose% /p:Configuration=%conf% /p:Platform=%platf% %1 %2 %3 %4 %5 %6 %7 %8 %9