1ff4fa62521ab87153c877312b755cf82fce7bc9
[mesa.git] / .appveyor / appveyor_msvc.bat
1 goto %1
2
3 :install
4 rem Check pip
5 if "%buildsystem%" == "scons" (
6 python --version
7 python -m pip --version
8 rem Install Mako
9 python -m pip install Mako==1.0.7
10 rem Install pywin32 extensions, needed by SCons
11 python -m pip install pypiwin32
12 rem Install python wheels, necessary to install SCons via pip
13 python -m pip install wheel
14 rem Install SCons
15 python -m pip install scons==3.0.1
16 call scons --version
17 ) else (
18 python --version
19 python -m pip install Mako meson
20 meson --version
21
22 rem Install pkg-config, which meson requires even on windows
23 cinst -y pkgconfiglite
24 )
25
26 rem Install flex/bison
27 set WINFLEXBISON_ARCHIVE=win_flex_bison-%WINFLEXBISON_VERSION%.zip
28 if not exist "%WINFLEXBISON_ARCHIVE%" appveyor DownloadFile "https://github.com/lexxmark/winflexbison/releases/download/v%WINFLEXBISON_VERSION%/%WINFLEXBISON_ARCHIVE%"
29 7z x -y -owinflexbison\ "%WINFLEXBISON_ARCHIVE%" > nul
30 set Path=%CD%\winflexbison;%Path%
31 win_flex --version
32 win_bison --version
33 rem Download and extract LLVM
34 if not exist "%LLVM_ARCHIVE%" appveyor DownloadFile "https://people.freedesktop.org/~jrfonseca/llvm/%LLVM_ARCHIVE%"
35 7z x -y "%LLVM_ARCHIVE%" > nul
36 if "%buildsystem%" == "scons" (
37 mkdir llvm\bin
38 set LLVM=%CD%\llvm
39 ) else (
40 move llvm subprojects\
41 copy .appveyor\llvm-wrap.meson subprojects\llvm\meson.build
42 )
43 goto :eof
44
45 :build_script
46 if "%buildsystem%" == "scons" (
47 call scons -j%NUMBER_OF_PROCESSORS% MSVC_VERSION=14.1 llvm=1
48 ) else (
49 call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" -arch=x86
50 rem We use default-library as static to affect any wraps (such as expat and zlib)
51 rem it would be better if we could set subprojects buildtype independently,
52 rem but I haven't written that patch yet :)
53 call meson builddir --backend=vs2017 --default-library=static -Dbuild-tests=true -Db_vscrt=mtd --buildtype=release -Dllvm=true -Dgallium-drivers=swrast -Dosmesa=gallium
54 pushd builddir
55 call msbuild mesa.sln /m
56 popd
57 )
58 goto :eof
59
60 :test_script
61 if "%buildsystem%" == "scons" (
62 call scons -j%NUMBER_OF_PROCESSORS% MSVC_VERSION=14.1 llvm=1 check
63 ) else (
64 call meson test -C builddir
65 )
66 goto :eof