blob: 838f6ef7632646e41a2c7bfcd63de097bfedd530 [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
9rem -d Set the configuration to Debug
10rem -e Pull in external libraries using get_externals.bat
11
Christian Heimes4a7cae52007-11-08 23:55:45 +000012setlocal
Christian Heimes5b5e81c2007-12-31 16:14:33 +000013set platf=Win32
14set conf=Release
Zachary Waree12fa652014-07-07 13:39:59 -050015set target=Build
Brian Curtin5c2725d2012-05-22 11:04:32 -050016set dir=%~dp0
Christian Heimes4a7cae52007-11-08 23:55:45 +000017
Christian Heimes5b5e81c2007-12-31 16:14:33 +000018:CheckOpts
Zachary Warec6f8c0a2014-07-31 23:58:27 -050019if '%1'=='-c' (set conf=%2) & shift & shift & goto CheckOpts
20if '%1'=='-p' (set platf=%2) & shift & shift & goto CheckOpts
21if '%1'=='-r' (set target=Rebuild) & shift & goto CheckOpts
22if '%1'=='-d' (set conf=Debug) & shift & goto CheckOpts
23if '%1'=='-e' call "%dir%get_externals.bat" & shift & goto CheckOpts
Christian Heimes4a7cae52007-11-08 23:55:45 +000024
Zachary Warec6f8c0a2014-07-31 23:58:27 -050025if '%platf%'=='x64' (set vs_platf=x86_amd64)
Zachary Waree12fa652014-07-07 13:39:59 -050026
27rem Setup the environment
28call "%VS100COMNTOOLS%..\..\VC\vcvarsall.bat" %vs_platf%
29
30rem Call on MSBuild to do the work, echo the command.
31rem Passing %1-9 is not the preferred option, but argument parsing in
32rem batch is, shall we say, "lackluster"
33echo on
34msbuild "%dir%pcbuild.sln" /t:%target% /p:Configuration=%conf% /p:Platform=%platf% %1 %2 %3 %4 %5 %6 %7 %8 %9