1@echo on 2 3SETLOCAL ENABLEDELAYEDEXPANSION 4 5SET PATH=C:\python36;C:\Program Files\cmake\bin;%PATH% 6SET SRC=%cd%\git\SwiftShader 7 8cd %SRC% || goto :error 9 10REM Lower the amount of debug info, to reduce Kokoro build times. 11SET LESS_DEBUG_INFO=1 12 13cd %SRC%\build || goto :error 14 15REM The currently used OS image comes with CMake 3.17.3. If a newer version is 16REM required one can update the image (go/radial/kokoro_windows_image), or 17REM uncomment the line below. 18REM choco upgrade cmake -y --limit-output --no-progress 19cmake --version 20 21rem To use ninja with CMake requires VC env vars 22call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" 23rem That batch file turned echo off, so turn it back on 24@echo on 25 26rem Note that we need to specify the C and C++ compiler only because Cygwin is in PATH and CMake finds GCC and picks that over MSVC 27cmake .. ^ 28 -G "%CMAKE_GENERATOR_TYPE%" ^ 29 -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" ^ 30 "-DREACTOR_BACKEND=%REACTOR_BACKEND%" ^ 31 "-DSWIFTSHADER_LLVM_VERSION=%LLVM_VERSION%" ^ 32 "-DREACTOR_VERIFY_LLVM_IR=1" ^ 33 "-DLESS_DEBUG_INFO=%LESS_DEBUG_INFO%" ^ 34 "-DSWIFTSHADER_BUILD_BENCHMARKS=1" || goto :error 35 36cmake --build . --config %BUILD_TYPE% || goto :error 37 38REM Run the unit tests. Some must be run from project root 39cd %SRC% || goto :error 40SET SWIFTSHADER_DISABLE_DEBUGGER_WAIT_DIALOG=1 41 42build\ReactorUnitTests.exe || goto :error 43build\system-unittests.exe || goto :error 44build\vk-unittests.exe || goto :error 45 46REM Incrementally build and run rr::Print unit tests 47cd %SRC%\build || goto :error 48cmake "-DREACTOR_ENABLE_PRINT=1" .. || goto :error 49cmake --build . --config %BUILD_TYPE% --target ReactorUnitTests || goto :error 50ReactorUnitTests.exe --gtest_filter=ReactorUnitTests.Print* || goto :error 51cmake "-DREACTOR_ENABLE_PRINT=0" .. || goto :error 52 53REM Incrementally build with REACTOR_EMIT_ASM_FILE and run unit test 54cd %SRC%\build || goto :error 55cmake "-DREACTOR_EMIT_ASM_FILE=1" .. || goto :error 56cmake --build . --config %BUILD_TYPE% --target ReactorUnitTests || goto :error 57ReactorUnitTests.exe --gtest_filter=ReactorUnitTests.EmitAsm || goto :error 58cmake "-DREACTOR_EMIT_ASM_FILE=0" .. || goto :error 59 60REM Incrementally build with REACTOR_EMIT_DEBUG_INFO to ensure it builds 61REM cd %SRC%\build || goto :error 62REM cmake "-DREACTOR_EMIT_DEBUG_INFO=1" .. || goto :error 63REM cmake --build . --config %BUILD_TYPE% --target ReactorUnitTests || goto :error 64REM cmake "-DREACTOR_EMIT_DEBUG_INFO=0" .. || goto :error 65 66REM Incrementally build with REACTOR_EMIT_PRINT_LOCATION to ensure it builds 67REM cd %SRC%\build || goto :error 68REM cmake "-DREACTOR_EMIT_PRINT_LOCATION=1" .. || goto :error 69REM cmake --build . --config %BUILD_TYPE% --target ReactorUnitTests || goto :error 70REM cmake "-DREACTOR_EMIT_PRINT_LOCATION=0" .. || goto :error 71 72exit /b 0 73 74:error 75exit /b !ERRORLEVEL! 76