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 19set SRC=%cd%\github\SPIRV-Tools 20 21:: Force usage of python 3.6 22set PATH=C:\python36;%PATH% 23 24:: Get dependencies 25cd %SRC% 26git clone --depth=1 https://github.com/KhronosGroup/SPIRV-Headers external/spirv-headers 27git clone https://github.com/google/googletest external/googletest 28cd external && cd googletest && git reset --hard 1fb1bb23bb8418dc73a5a9a82bbed31dc610fec7 && cd .. && cd .. 29git clone --depth=1 https://github.com/google/effcee external/effcee 30git clone --depth=1 https://github.com/google/re2 external/re2 31 32:: REM Install Bazel. 33wget -q https://github.com/bazelbuild/bazel/releases/download/0.29.1/bazel-0.29.1-windows-x86_64.zip 34unzip -q bazel-0.29.1-windows-x86_64.zip 35 36:: Set up MSVC 37call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 38set BAZEL_VS=C:\Program Files (x86)\Microsoft Visual Studio 14.0 39set BAZEL_VC=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC 40set BAZEL_SH=c:\tools\msys64\usr\bin\bash.exe 41set BAZEL_PYTHON=c:\tools\python2\python.exe 42 43:: ######################################### 44:: Start building. 45:: ######################################### 46echo "Build everything... %DATE% %TIME%" 47bazel.exe build :all 48if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL% 49echo "Build Completed %DATE% %TIME%" 50 51:: ############## 52:: Run the tests 53:: ############## 54echo "Running Tests... %DATE% %TIME%" 55bazel.exe test :all 56if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL% 57echo "Tests Completed %DATE% %TIME%" 58 59exit /b 0 60 61