Kokoro: install Ninja and add to PATH

Change-Id: I448eca39e6fc2f4c98a2ec72f36fbfcc25ffcc21
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118162
Reviewed-by: Ben Clayton <bclayton@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
This commit is contained in:
Antonio Maiorano 2023-02-01 12:38:27 +00:00 committed by Dawn LUCI CQ
parent 6b823a3de7
commit 51ef336933
1 changed files with 12 additions and 2 deletions

View File

@ -92,6 +92,17 @@ call gclient || goto :error
@echo off
popd
@REM Install Ninja after depot_tools to make sure it's in PATH before depot_tools
call :status "Fetching and installing Ninja"
@echo on
@REM set WINSDK_DLL_INSTALLER=https://go.microsoft.com/fwlink/?linkid=2164145
@REM set WINSDK_VERSION=10.0.20348.0
set NINJA_ZIP=https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip
curl -k -L %NINJA_ZIP% --output "%TEMP_DIR%\ninja.zip" || goto :error
powershell.exe -Command "Expand-Archive -LiteralPath '%TEMP_DIR%\ninja.zip' -DestinationPath '%TEMP_DIR%\ninja'" || goto :error
set PATH=%TEMP_DIR%\ninja;%PATH%
@echo off
call :status "Cloning to clean source directory"
@echo on
mkdir %SRC_DIR% || goto :error
@ -135,8 +146,7 @@ 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
rem We also need to specify the Ninja binary is ninja.bat because the Ninja picked up otherwise is depot_tools' shell script.
cmake %SRC_DIR% -G "Ninja" -DCMAKE_MAKE_PROGRAM="ninja.bat" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" %COMMON_CMAKE_FLAGS% || goto :error
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