From f748f2ae222ffcd6f20c7d78a4922c07f2880a5d Mon Sep 17 00:00:00 2001 From: Antonio Maiorano Date: Mon, 13 Dec 2021 19:15:28 +0000 Subject: [PATCH] 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 Kokoro: Kokoro Commit-Queue: Antonio Maiorano --- kokoro/windows/build.bat | 15 ++++++++++----- kokoro/windows/cmake-msvc2019-debug/build.bat | 1 - kokoro/windows/cmake-msvc2019-release/build.bat | 1 - 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/kokoro/windows/build.bat b/kokoro/windows/build.bat index 8ae65f2e13..1dfb553235 100644 --- a/kokoro/windows/build.bat +++ b/kokoro/windows/build.bat @@ -104,7 +104,7 @@ call :status "Configuring build system" @echo on mkdir %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 call :status "Building tint" @@ -113,13 +113,18 @@ rem Disable msbuild "Intermediate or Output directory cannot reside in Temporary set IgnoreWarnIntDirInTempDetected=true rem Add Python3 to path as this Kokoro image only has Python2 in it set PATH=C:\Python37;%PATH% -cmake %SRC_DIR% %CMAKE_FLAGS% %COMMON_CMAKE_FLAGS% || goto :error -cmake --build . --config %BUILD_TYPE% || goto :error +rem To use ninja with CMake requires VC env vars +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 call :status "Running tint_unittests" @echo on -%BUILD_TYPE%\tint_unittests.exe || goto :error +tint_unittests.exe || goto :error @echo off call :status "Testing test/test-all.sh" @@ -127,7 +132,7 @@ call :status "Testing test/test-all.sh" cd /d %SRC_DIR% || goto :error set PATH=C:\Program Files\Metal Developer Tools\macos\bin;%PATH% 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 call :status "Done" diff --git a/kokoro/windows/cmake-msvc2019-debug/build.bat b/kokoro/windows/cmake-msvc2019-debug/build.bat index f501277752..25db34775f 100644 --- a/kokoro/windows/cmake-msvc2019-debug/build.bat +++ b/kokoro/windows/cmake-msvc2019-debug/build.bat @@ -14,6 +14,5 @@ @echo on set BUILD_TYPE=Debug -set CMAKE_FLAGS=-G "Visual Studio 16 2019" -A x64 call %~dp0\..\build.bat exit /b %errorlevel% diff --git a/kokoro/windows/cmake-msvc2019-release/build.bat b/kokoro/windows/cmake-msvc2019-release/build.bat index 4984febc71..a2f607216b 100644 --- a/kokoro/windows/cmake-msvc2019-release/build.bat +++ b/kokoro/windows/cmake-msvc2019-release/build.bat @@ -14,6 +14,5 @@ @echo on set BUILD_TYPE=Release -set CMAKE_FLAGS=-G "Visual Studio 16 2019" -A x64 call %~dp0\..\build.bat exit /b %errorlevel%