• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 --depth=1 https://github.com/google/googletest          external/googletest
28git clone --depth=1 https://github.com/google/effcee              external/effcee
29git clone --depth=1 https://github.com/google/re2                 external/re2
30
31:: REM Install Bazel.
32wget -q https://github.com/bazelbuild/bazel/releases/download/0.29.1/bazel-0.29.1-windows-x86_64.zip
33unzip -q bazel-0.29.1-windows-x86_64.zip
34
35:: Set up MSVC
36call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64
37set BAZEL_VS=C:\Program Files (x86)\Microsoft Visual Studio 14.0
38set BAZEL_VC=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
39set BAZEL_SH=c:\tools\msys64\usr\bin\bash.exe
40set BAZEL_PYTHON=c:\tools\python2\python.exe
41
42:: #########################################
43:: Start building.
44:: #########################################
45echo "Build everything... %DATE% %TIME%"
46bazel.exe build :all
47if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
48echo "Build Completed %DATE% %TIME%"
49
50:: ##############
51:: Run the tests
52:: ##############
53echo "Running Tests... %DATE% %TIME%"
54bazel.exe test :all
55if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
56echo "Tests Completed %DATE% %TIME%"
57
58exit /b 0
59
60