From 9b04241516e23c9a5cdf9de861b2a278fc2185af Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 13 Jun 2024 10:34:57 -0700 Subject: [PATCH] utils: support VS Build Tools for building the SDKs `vswhere` does not report the buildtools installation. If the user only has the build tools installed, the necessary tools may still be available. Adjust the script to account for that. --- utils/build.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/utils/build.ps1 b/utils/build.ps1 index 06046abb1b6ff..b8b101346b195 100644 --- a/utils/build.ps1 +++ b/utils/build.ps1 @@ -836,11 +836,11 @@ function Build-CMakeProject { } if ($Platform -eq "Android") { - $vsWherePath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" - $vsInstallPath = & $vsWherePath -latest -property installationPath - if (Test-Path "${vsInstallPath}\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin") { - $env:Path = "${vsInstallPath}\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;${vsInstallPath}\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;${env:Path}" - TryAdd-KeyValue $Defines CMAKE_MAKE_PROGRAM "${vsInstallPath}\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe" + $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" + $VSInstallPath = & $vswhere -nologo -latest -products * -property installationPath + if (Test-Path "${VSInstallPath}\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin") { + $env:Path = "${VSInstallPath}\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;${VSInstallPath}\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;${env:Path}" + TryAdd-KeyValue $Defines CMAKE_MAKE_PROGRAM "${VSInstallPath}\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe" } else { throw "Missing CMake and Ninja in the visual studio installation that are needed to build Android" }