Christian Heimes | 4a7cae5 | 2007-11-08 23:55:45 +0000 | [diff] [blame] | 1 | @echo off |
Zachary Ware | e12fa65 | 2014-07-07 13:39:59 -0500 | [diff] [blame] | 2 | rem A batch program to build or rebuild a particular configuration, |
Christian Heimes | 5b5e81c | 2007-12-31 16:14:33 +0000 | [diff] [blame] | 3 | rem just for convenience. |
| 4 | |
Zachary Ware | e12fa65 | 2014-07-07 13:39:59 -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 -d Set the configuration to Debug |
| 10 | rem -e Pull in external libraries using get_externals.bat |
| 11 | |
Christian Heimes | 4a7cae5 | 2007-11-08 23:55:45 +0000 | [diff] [blame] | 12 | setlocal |
Christian Heimes | 5b5e81c | 2007-12-31 16:14:33 +0000 | [diff] [blame] | 13 | set platf=Win32 |
| 14 | set conf=Release |
Zachary Ware | e12fa65 | 2014-07-07 13:39:59 -0500 | [diff] [blame] | 15 | set target=Build |
Brian Curtin | 5c2725d | 2012-05-22 11:04:32 -0500 | [diff] [blame] | 16 | set dir=%~dp0 |
Christian Heimes | 4a7cae5 | 2007-11-08 23:55:45 +0000 | [diff] [blame] | 17 | |
Christian Heimes | 5b5e81c | 2007-12-31 16:14:33 +0000 | [diff] [blame] | 18 | :CheckOpts |
Zachary Ware | c6f8c0a | 2014-07-31 23:58:27 -0500 | [diff] [blame^] | 19 | if '%1'=='-c' (set conf=%2) & shift & shift & goto CheckOpts |
| 20 | if '%1'=='-p' (set platf=%2) & shift & shift & goto CheckOpts |
| 21 | if '%1'=='-r' (set target=Rebuild) & shift & goto CheckOpts |
| 22 | if '%1'=='-d' (set conf=Debug) & shift & goto CheckOpts |
| 23 | if '%1'=='-e' call "%dir%get_externals.bat" & shift & goto CheckOpts |
Christian Heimes | 4a7cae5 | 2007-11-08 23:55:45 +0000 | [diff] [blame] | 24 | |
Zachary Ware | c6f8c0a | 2014-07-31 23:58:27 -0500 | [diff] [blame^] | 25 | if '%platf%'=='x64' (set vs_platf=x86_amd64) |
Zachary Ware | e12fa65 | 2014-07-07 13:39:59 -0500 | [diff] [blame] | 26 | |
| 27 | rem Setup the environment |
| 28 | call "%VS100COMNTOOLS%..\..\VC\vcvarsall.bat" %vs_platf% |
| 29 | |
| 30 | rem Call on MSBuild to do the work, echo the command. |
| 31 | rem Passing %1-9 is not the preferred option, but argument parsing in |
| 32 | rem batch is, shall we say, "lackluster" |
| 33 | echo on |
| 34 | msbuild "%dir%pcbuild.sln" /t:%target% /p:Configuration=%conf% /p:Platform=%platf% %1 %2 %3 %4 %5 %6 %7 %8 %9 |