Dylan Baker | f066c96 | 2019-01-23 14:21:26 -0800 | [diff] [blame] | 1 | goto %1 |
| 2 | |
| 3 | :install |
| 4 | rem Check pip |
Jose Fonseca | 0f9fb7f | 2020-08-05 10:01:24 +0100 | [diff] [blame] | 5 | python --version |
| 6 | python -m pip install --upgrade pip |
| 7 | python -m pip --version |
Dylan Baker | f066c96 | 2019-01-23 14:21:26 -0800 | [diff] [blame] | 8 | if "%buildsystem%" == "scons" ( |
Dylan Baker | f066c96 | 2019-01-23 14:21:26 -0800 | [diff] [blame] | 9 | rem Install Mako |
Jose Fonseca | e2c614a | 2020-08-04 14:16:37 +0100 | [diff] [blame] | 10 | python -m pip install Mako==1.1.3 |
Dylan Baker | f066c96 | 2019-01-23 14:21:26 -0800 | [diff] [blame] | 11 | rem Install pywin32 extensions, needed by SCons |
| 12 | python -m pip install pypiwin32 |
| 13 | rem Install python wheels, necessary to install SCons via pip |
| 14 | python -m pip install wheel |
| 15 | rem Install SCons |
Jose Fonseca | e2c614a | 2020-08-04 14:16:37 +0100 | [diff] [blame] | 16 | python -m pip install scons==3.1.2 |
Dylan Baker | f066c96 | 2019-01-23 14:21:26 -0800 | [diff] [blame] | 17 | call scons --version |
| 18 | ) else ( |
Prodea Alexandru-Liviu | cc758f1 | 2019-11-14 21:45:23 +0000 | [diff] [blame] | 19 | python -m pip install Mako meson |
Dylan Baker | f066c96 | 2019-01-23 14:21:26 -0800 | [diff] [blame] | 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 |
Dylan Baker | fbb969b | 2019-10-15 11:16:01 -0700 | [diff] [blame] | 39 | ) else ( |
| 40 | move llvm subprojects\ |
| 41 | copy .appveyor\llvm-wrap.meson subprojects\llvm\meson.build |
Dylan Baker | f066c96 | 2019-01-23 14:21:26 -0800 | [diff] [blame] | 42 | ) |
| 43 | goto :eof |
| 44 | |
| 45 | :build_script |
| 46 | if "%buildsystem%" == "scons" ( |
Jose Fonseca | e2c614a | 2020-08-04 14:16:37 +0100 | [diff] [blame] | 47 | call scons -j%NUMBER_OF_PROCESSORS% MSVC_VERSION=14.2 machine=x86 llvm=1 |
Dylan Baker | f066c96 | 2019-01-23 14:21:26 -0800 | [diff] [blame] | 48 | ) else ( |
Dylan Baker | fbb969b | 2019-10-15 11:16:01 -0700 | [diff] [blame] | 49 | call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" -arch=x86 |
Dylan Baker | f066c96 | 2019-01-23 14:21:26 -0800 | [diff] [blame] | 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 :) |
Prodea Alexandru-Liviu | 48d6171 | 2019-10-19 14:44:44 +0000 | [diff] [blame] | 53 | call meson builddir --backend=vs2017 --default-library=static -Dbuild-tests=true -Db_vscrt=mtd --buildtype=release -Dllvm=true -Dgallium-drivers=swrast -Dosmesa=gallium |
Dylan Baker | f066c96 | 2019-01-23 14:21:26 -0800 | [diff] [blame] | 54 | pushd builddir |
| 55 | call msbuild mesa.sln /m |
| 56 | popd |
| 57 | ) |
| 58 | goto :eof |
| 59 | |
| 60 | :test_script |
| 61 | if "%buildsystem%" == "scons" ( |
Jose Fonseca | e2c614a | 2020-08-04 14:16:37 +0100 | [diff] [blame] | 62 | call scons -j%NUMBER_OF_PROCESSORS% MSVC_VERSION=14.2 machine=x86 llvm=1 check |
Dylan Baker | f066c96 | 2019-01-23 14:21:26 -0800 | [diff] [blame] | 63 | ) else ( |
| 64 | call meson test -C builddir |
| 65 | ) |
| 66 | goto :eof |