• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1@echo on
2
3SETLOCAL ENABLEDELAYEDEXPANSION
4
5SET PATH=C:\python312;%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 Use cmake-3.31.2 from the OS image.
16REM If a newer version is required one can update the image (go/radial/kokoro_windows_image),
17REM or REM uncomment the line below.
18REM choco upgrade cmake -y --limit-output --no-progress
19set PATH=c:\cmake-3.31.2\bin;%PATH%
20cmake --version
21
22rem To use ninja with CMake requires VC env vars
23call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
24rem That batch file turned echo off, so turn it back on
25@echo on
26
27rem 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
28cmake .. ^
29    -G "%CMAKE_GENERATOR_TYPE%" ^
30    -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" ^
31    "-DREACTOR_BACKEND=%REACTOR_BACKEND%" ^
32    "-DSWIFTSHADER_LLVM_VERSION=%LLVM_VERSION%" ^
33    "-DREACTOR_VERIFY_LLVM_IR=1" ^
34    "-DLESS_DEBUG_INFO=%LESS_DEBUG_INFO%" ^
35    "-DSWIFTSHADER_BUILD_BENCHMARKS=1" || goto :error
36
37cmake --build . --config %BUILD_TYPE%   || goto :error
38
39REM Run the unit tests. Some must be run from project root
40cd %SRC% || goto :error
41SET SWIFTSHADER_DISABLE_DEBUGGER_WAIT_DIALOG=1
42
43build\ReactorUnitTests.exe || goto :error
44build\system-unittests.exe || goto :error
45build\vk-unittests.exe || goto :error
46
47REM Incrementally build and run rr::Print unit tests
48cd %SRC%\build || goto :error
49cmake "-DREACTOR_ENABLE_PRINT=1" .. || goto :error
50cmake --build . --config %BUILD_TYPE% --target ReactorUnitTests || goto :error
51ReactorUnitTests.exe --gtest_filter=ReactorUnitTests.Print* || goto :error
52cmake "-DREACTOR_ENABLE_PRINT=0" .. || goto :error
53
54REM Incrementally build with REACTOR_EMIT_ASM_FILE and run unit test
55cd %SRC%\build || goto :error
56cmake "-DREACTOR_EMIT_ASM_FILE=1" .. || goto :error
57cmake --build . --config %BUILD_TYPE% --target ReactorUnitTests || goto :error
58ReactorUnitTests.exe --gtest_filter=ReactorUnitTests.EmitAsm || goto :error
59cmake "-DREACTOR_EMIT_ASM_FILE=0" .. || goto :error
60
61REM Incrementally build with REACTOR_EMIT_DEBUG_INFO to ensure it builds
62REM cd %SRC%\build || goto :error
63REM cmake "-DREACTOR_EMIT_DEBUG_INFO=1" .. || goto :error
64REM cmake --build . --config %BUILD_TYPE% --target ReactorUnitTests || goto :error
65REM cmake "-DREACTOR_EMIT_DEBUG_INFO=0" .. || goto :error
66
67REM Incrementally build with REACTOR_EMIT_PRINT_LOCATION to ensure it builds
68REM cd %SRC%\build || goto :error
69REM cmake "-DREACTOR_EMIT_PRINT_LOCATION=1" .. || goto :error
70REM cmake --build . --config %BUILD_TYPE% --target ReactorUnitTests || goto :error
71REM cmake "-DREACTOR_EMIT_PRINT_LOCATION=0" .. || goto :error
72
73exit /b 0
74
75:error
76exit /b !ERRORLEVEL!
77