Zachary Ware | 4c9c848 | 2015-04-13 11:59:54 -0500 | [diff] [blame] | 1 | @echo off
|
Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame^] | 2 | rem A batch program to build or rebuild a particular configuration,
|
Zachary Ware | 4c9c848 | 2015-04-13 11:59:54 -0500 | [diff] [blame] | 3 | rem just for convenience.
|
| 4 |
|
Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame^] | 5 | rem Arguments:
|
| 6 | rem -c Set the configuration (default: Release)
|
| 7 | rem -p Set the platform (x64 or Win32, default: Win32)
|
| 8 | rem -r Target Rebuild instead of Build
|
| 9 | rem -t Set the target manually (Build, Rebuild, Clean, or CleanAll)
|
| 10 | rem -d Set the configuration to Debug
|
| 11 | rem -e Pull in external libraries using get_externals.bat
|
| 12 | rem -M Disable parallel build
|
| 13 | rem -v Increased output messages
|
| 14 |
|
Zachary Ware | 4c9c848 | 2015-04-13 11:59:54 -0500 | [diff] [blame] | 15 | setlocal
|
| 16 | set platf=Win32
|
Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame^] | 17 | set vs_platf=x86
|
Zachary Ware | 4c9c848 | 2015-04-13 11:59:54 -0500 | [diff] [blame] | 18 | set conf=Release
|
Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame^] | 19 | set target=Build
|
Zachary Ware | 4c9c848 | 2015-04-13 11:59:54 -0500 | [diff] [blame] | 20 | set dir=%~dp0
|
Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame^] | 21 | set parallel=/m
|
| 22 | set verbose=/nologo /v:m
|
Zachary Ware | 4c9c848 | 2015-04-13 11:59:54 -0500 | [diff] [blame] | 23 |
|
| 24 | :CheckOpts
|
Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame^] | 25 | if '%1'=='-c' (set conf=%2) & shift & shift & goto CheckOpts
|
| 26 | if '%1'=='-p' (set platf=%2) & shift & shift & goto CheckOpts
|
| 27 | if '%1'=='-r' (set target=Rebuild) & shift & goto CheckOpts
|
| 28 | if '%1'=='-t' (set target=%2) & shift & shift & goto CheckOpts
|
| 29 | if '%1'=='-d' (set conf=Debug) & shift & goto CheckOpts
|
| 30 | if '%1'=='-e' call "%dir%get_externals.bat" & shift & goto CheckOpts
|
| 31 | if '%1'=='-M' (set parallel=) & shift & goto CheckOpts
|
| 32 | if '%1'=='-v' (set verbose=/v:n) & shift & goto CheckOpts
|
Zachary Ware | 4c9c848 | 2015-04-13 11:59:54 -0500 | [diff] [blame] | 33 |
|
Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame^] | 34 | if '%platf%'=='x64' (set vs_platf=x86_amd64)
|
| 35 |
|
| 36 | rem Setup the environment
|
| 37 | call "%dir%env.bat" %vs_platf% >nul
|
| 38 |
|
| 39 | rem Call on MSBuild to do the work, echo the command.
|
| 40 | rem Passing %1-9 is not the preferred option, but argument parsing in
|
| 41 | rem batch is, shall we say, "lackluster"
|
| 42 | echo on
|
| 43 | msbuild "%dir%pcbuild.proj" /t:%target% %parallel% %verbose% /p:Configuration=%conf% /p:Platform=%platf% %1 %2 %3 %4 %5 %6 %7 %8 %9
|