Kokoro: use ninja to build faster for Windows builds

Saves about 5 minutes per Windows build.

Bug: tint:940
Change-Id: Ib03fb6ca9d51575d8ee82324be7040153e5536bf
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/72540
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
Antonio Maiorano 2021-12-13 19:15:28 +00:00 committed by Tint LUCI CQ
parent 6d67dad7fe
commit f748f2ae22
3 changed files with 10 additions and 7 deletions

View File

@ -104,7 +104,7 @@ call :status "Configuring build system"
@echo on @echo on
mkdir %BUILD_DIR% mkdir %BUILD_DIR%
cd /d %BUILD_DIR% cd /d %BUILD_DIR%
set COMMON_CMAKE_FLAGS=-DTINT_BUILD_DOCS=O set COMMON_CMAKE_FLAGS=-DTINT_BUILD_DOCS=O -DCMAKE_BUILD_TYPE=%BUILD_TYPE%
@echo off @echo off
call :status "Building tint" call :status "Building tint"
@ -113,13 +113,18 @@ rem Disable msbuild "Intermediate or Output directory cannot reside in Temporary
set IgnoreWarnIntDirInTempDetected=true set IgnoreWarnIntDirInTempDetected=true
rem Add Python3 to path as this Kokoro image only has Python2 in it rem Add Python3 to path as this Kokoro image only has Python2 in it
set PATH=C:\Python37;%PATH% set PATH=C:\Python37;%PATH%
cmake %SRC_DIR% %CMAKE_FLAGS% %COMMON_CMAKE_FLAGS% || goto :error rem To use ninja with CMake requires VC env vars
cmake --build . --config %BUILD_TYPE% || goto :error call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
@echo on
rem 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
cmake %SRC_DIR% -G "Ninja" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" %COMMON_CMAKE_FLAGS% || goto :error
cmake --build . || goto :error
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" /clean_env
@echo off @echo off
call :status "Running tint_unittests" call :status "Running tint_unittests"
@echo on @echo on
%BUILD_TYPE%\tint_unittests.exe || goto :error tint_unittests.exe || goto :error
@echo off @echo off
call :status "Testing test/test-all.sh" call :status "Testing test/test-all.sh"
@ -127,7 +132,7 @@ call :status "Testing test/test-all.sh"
cd /d %SRC_DIR% || goto :error cd /d %SRC_DIR% || goto :error
set PATH=C:\Program Files\Metal Developer Tools\macos\bin;%PATH% set PATH=C:\Program Files\Metal Developer Tools\macos\bin;%PATH%
where metal.exe where metal.exe
git bash -- ./test/test-all.sh ../tint-build/%BUILD_TYPE%/tint.exe --verbose git bash -- ./test/test-all.sh ../tint-build/tint.exe --verbose
@echo off @echo off
call :status "Done" call :status "Done"

View File

@ -14,6 +14,5 @@
@echo on @echo on
set BUILD_TYPE=Debug set BUILD_TYPE=Debug
set CMAKE_FLAGS=-G "Visual Studio 16 2019" -A x64
call %~dp0\..\build.bat call %~dp0\..\build.bat
exit /b %errorlevel% exit /b %errorlevel%

View File

@ -14,6 +14,5 @@
@echo on @echo on
set BUILD_TYPE=Release set BUILD_TYPE=Release
set CMAKE_FLAGS=-G "Visual Studio 16 2019" -A x64
call %~dp0\..\build.bat call %~dp0\..\build.bat
exit /b %errorlevel% exit /b %errorlevel%