| 1 |
:: Copyright (c) 2019 Google LLC. |
| 2 |
:: |
| 3 |
:: Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
:: you may not use this file except in compliance with the License. |
| 5 |
:: You may obtain a copy of the License at |
| 6 |
:: |
| 7 |
:: http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
:: |
| 9 |
:: Unless required by applicable law or agreed to in writing, software |
| 10 |
:: distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
:: See the License for the specific language governing permissions and |
| 13 |
:: limitations under the License. |
| 14 |
:: |
| 15 |
:: Windows Build Script. |
| 16 |
|
| 17 |
@echo on |
| 18 |
|
| 19 |
set SRC=%cd%\github\SPIRV-Tools |
| 20 |
|
| 21 |
:: Force usage of python 3.6 |
| 22 |
set PATH=C:\python36;%PATH% |
| 23 |
|
| 24 |
:: Get dependencies |
| 25 |
cd %SRC% |
| 26 |
git clone --depth=1 https://github.com/KhronosGroup/SPIRV-Headers external/spirv-headers |
| 27 |
git clone https://github.com/google/googletest external/googletest |
| 28 |
cd external && cd googletest && git reset --hard 1fb1bb23bb8418dc73a5a9a82bbed31dc610fec7 && cd .. && cd .. |
| 29 |
git clone --depth=1 https://github.com/google/effcee external/effcee |
| 30 |
git clone --depth=1 https://github.com/google/re2 external/re2 |
| 31 |
|
| 32 |
:: REM Install Bazel. |
| 33 |
wget -q https://github.com/bazelbuild/bazel/releases/download/0.29.1/bazel-0.29.1-windows-x86_64.zip |
| 34 |
unzip -q bazel-0.29.1-windows-x86_64.zip |
| 35 |
|
| 36 |
:: Set up MSVC |
| 37 |
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 |
| 38 |
set BAZEL_VS=C:\Program Files (x86)\Microsoft Visual Studio 14.0 |
| 39 |
set BAZEL_VC=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC |
| 40 |
set BAZEL_SH=c:\tools\msys64\usr\bin\bash.exe |
| 41 |
set BAZEL_PYTHON=c:\tools\python2\python.exe |
| 42 |
|
| 43 |
:: ######################################### |
| 44 |
:: Start building. |
| 45 |
:: ######################################### |
| 46 |
echo "Build everything... %DATE% %TIME%" |
| 47 |
bazel.exe build :all |
| 48 |
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL% |
| 49 |
echo "Build Completed %DATE% %TIME%" |
| 50 |
|
| 51 |
:: ############## |
| 52 |
:: Run the tests |
| 53 |
:: ############## |
| 54 |
echo "Running Tests... %DATE% %TIME%" |
| 55 |
bazel.exe test :all |
| 56 |
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL% |
| 57 |
echo "Tests Completed %DATE% %TIME%" |
| 58 |
|
| 59 |
exit /b 0 |
| 60 |
|