Skip to content

Commit 5b9e5a2

Browse files
authored
Merge pull request swiftlang#74397 from compnerd/buildtools
utils: support VS Build Tools for building the SDKs
2 parents 8528951 + 9b04241 commit 5b9e5a2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

utils/build.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -836,11 +836,11 @@ function Build-CMakeProject {
836836
}
837837

838838
if ($Platform -eq "Android") {
839-
$vsWherePath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
840-
$vsInstallPath = & $vsWherePath -latest -property installationPath
841-
if (Test-Path "${vsInstallPath}\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin") {
842-
$env:Path = "${vsInstallPath}\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;${vsInstallPath}\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;${env:Path}"
843-
TryAdd-KeyValue $Defines CMAKE_MAKE_PROGRAM "${vsInstallPath}\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe"
839+
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
840+
$VSInstallPath = & $vswhere -nologo -latest -products * -property installationPath
841+
if (Test-Path "${VSInstallPath}\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin") {
842+
$env:Path = "${VSInstallPath}\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;${VSInstallPath}\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;${env:Path}"
843+
TryAdd-KeyValue $Defines CMAKE_MAKE_PROGRAM "${VSInstallPath}\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe"
844844
} else {
845845
throw "Missing CMake and Ninja in the visual studio installation that are needed to build Android"
846846
}

0 commit comments

Comments
 (0)