blob: 54498ca28a24719cffebd122fca8f7ca1f52f844 [file] [log] [blame]
Zachary Ware6b6e6872017-06-10 14:58:42 -05001@echo off
2setlocal
3set D=%~dp0
4set PCBUILD=%D%..\..\PCBuild\
5
6set BUILDX86=
7set BUILDX64=
8set REBUILD=
9set OUTPUT=
10set PACKAGES=
11
12:CheckOpts
13if "%~1" EQU "-h" goto Help
14if "%~1" EQU "-x86" (set BUILDX86=1) && shift && goto CheckOpts
15if "%~1" EQU "-x64" (set BUILDX64=1) && shift && goto CheckOpts
16if "%~1" EQU "-r" (set REBUILD=-r) && shift && goto CheckOpts
17if "%~1" EQU "-o" (set OUTPUT="/p:OutputPath=%~2") && shift && shift && goto CheckOpts
18if "%~1" EQU "--out" (set OUTPUT="/p:OutputPath=%~2") && shift && shift && goto CheckOpts
19if "%~1" EQU "-p" (set PACKAGES=%PACKAGES% %~2) && shift && shift && goto CheckOpts
20
21if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1)
22
23call "%D%..\msi\get_externals.bat"
Steve Dower40a23e82017-06-19 10:34:25 -070024call "%PCBUILD%find_msbuild.bat" %MSBUILD%
25if ERRORLEVEL 1 (echo Cannot locate MSBuild.exe on PATH or as MSBUILD variable & exit /b 2)
Zachary Ware6b6e6872017-06-10 14:58:42 -050026
27if defined PACKAGES set PACKAGES="/p:Packages=%PACKAGES%"
28
29if defined BUILDX86 (
30 if defined REBUILD ( call "%PCBUILD%build.bat" -e -r
31 ) else if not exist "%PCBUILD%win32\python.exe" call "%PCBUILD%build.bat" -e
32 if errorlevel 1 goto :eof
33
Steve Dower40a23e82017-06-19 10:34:25 -070034 %MSBUILD% "%D%make_pkg.proj" /p:Configuration=Release /p:Platform=x86 %OUTPUT% %PACKAGES%
Zachary Ware6b6e6872017-06-10 14:58:42 -050035 if errorlevel 1 goto :eof
36)
37
38if defined BUILDX64 (
39 if defined REBUILD ( call "%PCBUILD%build.bat" -p x64 -e -r
40 ) else if not exist "%PCBUILD%amd64\python.exe" call "%PCBUILD%build.bat" -p x64 -e
41 if errorlevel 1 goto :eof
42
Steve Dower40a23e82017-06-19 10:34:25 -070043 %MSBUILD% "%D%make_pkg.proj" /p:Configuration=Release /p:Platform=x64 %OUTPUT% %PACKAGES%
Zachary Ware6b6e6872017-06-10 14:58:42 -050044 if errorlevel 1 goto :eof
45)
46
47exit /B 0
48
49:Help
50echo build.bat [-x86] [-x64] [--out DIR] [-r] [-h]
51echo.
52echo -x86 Build x86 installers
53echo -x64 Build x64 installers
54echo -r Rebuild rather than incremental build
55echo --out [DIR] Override output directory
56echo -h Show usage