blob: cde88c5a7ad5b8da71e9c84bd65a259993dac9c7 [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
Christian Heimesa8223142008-02-09 20:58:00 +000019if "%1"=="-c" (set conf=%2) & shift & shift & goto CheckOpts
Christian Heimes5b5e81c2007-12-31 16:14:33 +000020if "%1"=="-p" (set platf=%2) & shift & shift & goto CheckOpts
Zachary Waree12fa652014-07-07 13:39:59 -050021if "%1"=="-r" (set target=Rebuild) & shift & goto CheckOpts
Christian Heimesa8223142008-02-09 20:58:00 +000022if "%1"=="-d" (set conf=Debug) & shift & goto CheckOpts
Zachary Waree12fa652014-07-07 13:39:59 -050023if "%1"=="-e" call "%dir%get_externals.bat" & shift & goto CheckOpts
Christian Heimes4a7cae52007-11-08 23:55:45 +000024
Zachary Waree12fa652014-07-07 13:39:59 -050025if "%platf%"=="x64" (set vs_platf=x86_amd64)
26
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