Use latest Android SDK toolchain

This commit is contained in:
2026-06-05 12:28:47 +02:00
parent ac4fef8346
commit c761cd39fd
11 changed files with 319 additions and 15 deletions

View File

@@ -96,12 +96,25 @@ function Expand-ArgumentList {
$Presets = @(Expand-ArgumentList -Values $Presets)
$Targets = @(Expand-ArgumentList -Values $Targets)
$cmakeCommand = "cmake"
$androidToolchain = $null
if ($Presets | Where-Object { $_ -like "android-*" }) {
. "$PSScriptRoot\android-sdk-env.ps1"
$androidToolchain = Set-AndroidSdkToolchainEnvironment
$cmakeCommand = $androidToolchain.cmakeCommand
}
$started = Get-Date
$results = @()
$overallExitCode = 0
foreach ($preset in $Presets) {
& cmake --preset $preset
$presetCmakeCommand = $cmakeCommand
if ($androidToolchain -and $preset -notlike "android-*") {
$presetCmakeCommand = "cmake"
}
& $presetCmakeCommand --preset $preset
$configureExitCode = $LASTEXITCODE
if ($configureExitCode -ne 0) {
$overallExitCode = $configureExitCode
@@ -118,7 +131,7 @@ foreach ($preset in $Presets) {
$buildArgs += @("--target", $target)
}
& cmake @buildArgs
& $presetCmakeCommand @buildArgs
$buildExitCode = $LASTEXITCODE
if ($buildExitCode -ne 0 -and $overallExitCode -eq 0) {
$overallExitCode = $buildExitCode
@@ -137,6 +150,7 @@ $elapsed = [int]((Get-Date) - $started).TotalMilliseconds
command = "platform-build"
exitCode = $overallExitCode
elapsedMs = $elapsed
androidToolchain = $androidToolchain
results = $results
} | ConvertTo-Json -Compress -Depth 6