|
| 1 | +@echo off |
| 2 | +setlocal |
| 3 | +set D=%~dp0 |
| 4 | +set PCBUILD=%D%..\..\PCBuild\ |
| 5 | + |
| 6 | +set BUILDX86= |
| 7 | +set BUILDX64= |
| 8 | +set REBUILD= |
| 9 | +set OUTPUT= |
| 10 | +set PACKAGES= |
| 11 | + |
| 12 | +:CheckOpts |
| 13 | +if "%~1" EQU "-h" goto Help |
| 14 | +if "%~1" EQU "-x86" (set BUILDX86=1) && shift && goto CheckOpts |
| 15 | +if "%~1" EQU "-x64" (set BUILDX64=1) && shift && goto CheckOpts |
| 16 | +if "%~1" EQU "-r" (set REBUILD=-r) && shift && goto CheckOpts |
| 17 | +if "%~1" EQU "-o" (set OUTPUT="/p:OutputPath=%~2") && shift && shift && goto CheckOpts |
| 18 | +if "%~1" EQU "--out" (set OUTPUT="/p:OutputPath=%~2") && shift && shift && goto CheckOpts |
| 19 | +if "%~1" EQU "-p" (set PACKAGES=%PACKAGES% %~2) && shift && shift && goto CheckOpts |
| 20 | + |
| 21 | +if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1) |
| 22 | + |
| 23 | +call "%D%..\msi\get_externals.bat" |
| 24 | +call "%PCBUILD%env.bat" x86 |
| 25 | + |
| 26 | +if defined PACKAGES set PACKAGES="/p:Packages=%PACKAGES%" |
| 27 | + |
| 28 | +if defined BUILDX86 ( |
| 29 | + if defined REBUILD ( call "%PCBUILD%build.bat" -e -r |
| 30 | + ) else if not exist "%PCBUILD%win32\python.exe" call "%PCBUILD%build.bat" -e |
| 31 | + if errorlevel 1 goto :eof |
| 32 | + |
| 33 | + msbuild "%D%make_pkg.proj" /p:Configuration=Release /p:Platform=x86 %OUTPUT% %PACKAGES% |
| 34 | + if errorlevel 1 goto :eof |
| 35 | +) |
| 36 | + |
| 37 | +if defined BUILDX64 ( |
| 38 | + if defined REBUILD ( call "%PCBUILD%build.bat" -p x64 -e -r |
| 39 | + ) else if not exist "%PCBUILD%amd64\python.exe" call "%PCBUILD%build.bat" -p x64 -e |
| 40 | + if errorlevel 1 goto :eof |
| 41 | + |
| 42 | + msbuild "%D%make_pkg.proj" /p:Configuration=Release /p:Platform=x64 %OUTPUT% %PACKAGES% |
| 43 | + if errorlevel 1 goto :eof |
| 44 | +) |
| 45 | + |
| 46 | +exit /B 0 |
| 47 | + |
| 48 | +:Help |
| 49 | +echo build.bat [-x86] [-x64] [--out DIR] [-r] [-h] |
| 50 | +echo. |
| 51 | +echo -x86 Build x86 installers |
| 52 | +echo -x64 Build x64 installers |
| 53 | +echo -r Rebuild rather than incremental build |
| 54 | +echo --out [DIR] Override output directory |
| 55 | +echo -h Show usage |
0 commit comments