1:: Copyright The Amber Authors. 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@echo on 16 17set BUILD_ROOT=%cd% 18set SRC=%cd%\github\amber 19set BUILD_TYPE=%1 20 21choco install cmake --yes --no-progress --limit-output 22choco upgrade cmake --yes --no-progress --limit-output 23 24:: Force usage of python 3.6 and add cmake to the path. 25set PATH=C:\python36;"C:\Program Files\CMake\bin";%PATH% 26 27cd %SRC% 28python tools\git-sync-deps 29 30:: ######################################### 31:: set up msvc build env 32:: ######################################### 33call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 34echo "Using VS 2017..." 35 36cmake --version 37 38cd %SRC% 39mkdir build 40cd build 41 42:: ######################################### 43:: Start building. 44:: ######################################### 45echo "Starting build... %DATE% %TIME%" 46if "%KOKORO_GITHUB_COMMIT%." == "." ( 47 set BUILD_SHA=%KOKORO_GITHUB_PULL_REQUEST_COMMIT% 48) else ( 49 set BUILD_SHA=%KOKORO_GITHUB_COMMIT% 50) 51 52cmake -GNinja -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe -DAMBER_USE_LOCAL_VULKAN=1 .. 53if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL% 54 55echo "Build everything... %DATE% %TIME%" 56ninja 57if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL% 58echo "Build Completed %DATE% %TIME%" 59 60:: ################################################ 61:: Run the tests (We no longer run tests on VS2013) 62:: ################################################ 63echo "Running Tests... %DATE% %TIME%" 64amber_unittests 65if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL% 66echo "Tests Completed %DATE% %TIME%" 67 68exit /b %ERRORLEVEL% 69