forked from musescore/MuseScore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
before_build.bat
61 lines (54 loc) · 2.86 KB
/
before_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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
:: set platform-dependent variables
IF "%PLATFORM%" == "x64" (
SET "QTURL=https://utils.musescore.org.s3.amazonaws.com/qt598_msvc2017_64.7z"
SET "QTDIR=%cd%\qt\msvc2017_64" & :: uncomment to use our Qt
SET "QTCACHE=qt598_msvc2017_64.7z" & :: bump version here and .appveyor.yml to trigger cache rebuild when upgrading Qt
:: SET "QTDIR=C:\Qt\5.12.4\msvc2017_64" & :: uncomment to use AppVeyor's Qt
SET "TARGET_PROCESSOR_BITS=64"
SET "TARGET_PROCESSOR_ARCH=x86_64"
) ELSE (
SET "QTURL=https://utils.musescore.org.s3.amazonaws.com/qt598_msvc2015.7z"
SET "QTDIR=%cd%\qt\msvc2015" & :: uncomment to use our Qt
SET "QTCACHE=qt598_msvc2015.7z" & :: bump version here and .appveyor.yml to trigger cache rebuild when upgrading Qt
:: SET "QTDIR=C:\Qt\5.12.4\msvc2017" & :: uncomment to use AppVeyor's Qt
SET "TARGET_PROCESSOR_BITS=32"
SET "TARGET_PROCESSOR_ARCH=x86"
)
:: Download Qt if necessary
IF NOT EXIST "%QTCACHE%" ( START " " /wait "C:\cygwin64\bin\wget.exe" --no-check-certificate "%QTURL%" -O "%QTCACHE%" )
START " " /wait "7z" x -y "%QTCACHE%" "-oqt" & :: extract into `qt` directory
:: keep full PATH for later
SET OLD_PATH=%PATH%
mkdir archive
cd archive
:: download dependencies if necessary
IF NOT EXIST dependencies.7z ( START " " /wait "C:\cygwin64\bin\wget.exe" --no-check-certificate "http://utils.musescore.org.s3.amazonaws.com/musescore_dependencies_win32.7z" -O dependencies.7z )
:: copy dependencies
START " " /wait "7z" x -y dependencies.7z > nul
CD dependencies
XCOPY Jack "C:\Program Files (x86)\Jack" /E /I /Y
XCOPY ccache "C:\ccache" /E /I /Y
CD C:\MuseScore
IF NOT EXIST dependencies.zip ( START " " /wait "C:\cygwin64\bin\wget.exe" --no-check-certificate "https://s3.amazonaws.com/utils.musescore.org/dependencies.7z" -O dependencies.zip )
:: assuming dependencies.zip to contain the dependencies directory (with is subdirs)
START " " /wait "7z" x -y dependencies.zip > nul
:: test
CD dependencies\include
CD C:\MuseScore
MKDIR breakpad_tools
CD breakpad_tools
SET TOOLS_ARCHIVE=dump_syms.7z
IF NOT EXIST %TOOLS_ARCHIVE% ( START " " /wait "C:\cygwin64\bin\wget.exe" --no-check-certificate "https://s3.amazonaws.com/utils.musescore.org/dump_syms.7z" -O %TOOLS_ARCHIVE% )
START " " /wait "7z" x -y %TOOLS_ARCHIVE% > nul
CD C:\MuseScore
:: is MuseScore stable? Check here, no grep in PATH later on
for /f "delims=" %%i in ('bash -c "cmake -P config.cmake | grep -P 'MSCORE_UNSTABLE\s+TRUE'"') do set NIGHTLY_BUILD=%%i
for /f %%i in ('bash -c "cmake -P config.cmake | grep -oP 'MUSESCORE_VERSION_FULL\s+\K.*'"') do set MUSESCORE_VERSION_FULL=%%i
:: get revision number
SET "PATH=%QTDIR%\bin;%PATH%"
qmake --version & :: check qt is in %PATH%
call C:\MuseScore\msvc_build.bat revision
git rev-parse --short=7 HEAD > mscore/revision.h
SET /p MSREVISION=<mscore\revision.h
:: set ccache dir
SET CCACHE_DIR=C:\ccache\cache