-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.bat
35 lines (35 loc) · 1.17 KB
/
build.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
@echo off
title Building MpvDeclarativeWrapper
setlocal
if exist "%~dp0build.user.bat" call "%~dp0build.user.bat"
set vcvarsallpath=
set vs2017path=
for /f "delims=" %%A in ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -property installationPath -latest -requires Microsoft.Component.MSBuild Microsoft.VisualStudio.Component.VC.Tools.x86.x64') do set vs2017path=%%A
set vcvarsallpath=%vs2017path%\VC\Auxiliary\Build\vcvarsall.bat
if not exist "%vcvarsallpath%" (
echo Cannot find [vcvarsall.bat], if you did't install Visual Studio to it's default location, please change this script and re-run it.
endlocal
pause
exit /b
)
if not defined apparch set apparch=x64
call "%vcvarsallpath%" %apparch%
cd /d "%~dp0"
if exist doc rd /s /q doc
if exist build rd /s /q build
md build
cd build
if not defined qtspec set qtspec=win32-msvc
if not defined prjcfg set prjcfg=silent
qmake "%~dp0mpvdeclarativewrapper.pro" -spec %qtspec% "CONFIG+=release qtquickcompiler %prjcfg%"
set maketool=jom
where %maketool%
if %ERRORLEVEL% neq 0 set maketool=nmake
%maketool% qmake_all
%maketool%
%maketool% qmltypes
%maketool% install
cd "%~dp0"
endlocal
rd /s /q build
exit /b