blob: fa9f403f2f92bcac926179e02474d338829f95d7 [file] [log] [blame]
Zachary Ware4c9c8482015-04-13 11:59:54 -05001@echo off
Zachary Ware774ac372015-04-13 12:11:40 -05002rem A batch program to build or rebuild a particular configuration,
Zachary Ware4c9c8482015-04-13 11:59:54 -05003rem just for convenience.
4
Zachary Ware774ac372015-04-13 12:11:40 -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
9rem -t Set the target manually (Build, Rebuild, Clean, or CleanAll)
10rem -d Set the configuration to Debug
11rem -e Pull in external libraries using get_externals.bat
12rem -M Disable parallel build
13rem -v Increased output messages
14
Zachary Ware4c9c8482015-04-13 11:59:54 -050015setlocal
16set platf=Win32
Zachary Ware774ac372015-04-13 12:11:40 -050017set vs_platf=x86
Zachary Ware4c9c8482015-04-13 11:59:54 -050018set conf=Release
Zachary Ware774ac372015-04-13 12:11:40 -050019set target=Build
Zachary Ware4c9c8482015-04-13 11:59:54 -050020set dir=%~dp0
Zachary Ware774ac372015-04-13 12:11:40 -050021set parallel=/m
22set verbose=/nologo /v:m
Zachary Ware4c9c8482015-04-13 11:59:54 -050023
24:CheckOpts
Zachary Ware774ac372015-04-13 12:11:40 -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
28if '%1'=='-t' (set target=%2) & shift & shift & goto CheckOpts
29if '%1'=='-d' (set conf=Debug) & shift & goto CheckOpts
30if '%1'=='-e' call "%dir%get_externals.bat" & shift & goto CheckOpts
31if '%1'=='-M' (set parallel=) & shift & goto CheckOpts
32if '%1'=='-v' (set verbose=/v:n) & shift & goto CheckOpts
Zachary Ware4c9c8482015-04-13 11:59:54 -050033
Zachary Ware774ac372015-04-13 12:11:40 -050034if '%platf%'=='x64' (set vs_platf=x86_amd64)
35
36rem Setup the environment
37call "%dir%env.bat" %vs_platf% >nul
38
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
43msbuild "%dir%pcbuild.proj" /t:%target% %parallel% %verbose% /p:Configuration=%conf% /p:Platform=%platf% %1 %2 %3 %4 %5 %6 %7 %8 %9