@@ -558,12 +558,34 @@ function Get-InstallDir([Hashtable] $Platform) {
558
558
$HostPlatform.ToolchainInstallRoot = " $ ( Get-InstallDir $HostPlatform ) \Toolchains\$ProductVersion +$Variant "
559
559
560
560
# Build functions
561
- function Invoke-BuildStep ([string ] $Name , [Hashtable ] $Platform ) {
561
+ function Invoke-BuildStep {
562
+ [CmdletBinding (PositionalBinding = $false )]
563
+ param
564
+ (
565
+ [Parameter (Position = 0 , Mandatory )]
566
+ [string ] $Name ,
567
+ [Parameter (Position = 1 , Mandatory )]
568
+ [Hashtable ] $Platform ,
569
+ [Parameter (ValueFromRemainingArguments )]
570
+ $RemainingArgs
571
+ )
572
+
562
573
if ($Summary ) {
563
574
$Stopwatch = [Diagnostics.Stopwatch ]::StartNew()
564
575
}
565
576
566
- & $Name $Platform @Args
577
+ $SplatArgs = @ {}
578
+ foreach ($Arg in $RemainingArgs ) {
579
+ if ($Arg -is [Hashtable ]) {
580
+ $SplatArgs += $Arg
581
+ } elseif ($Arg -is [string ]) {
582
+ $SplatArgs [$Arg.TrimStart (' -' )] = $true
583
+ } else {
584
+ throw " $Arg is unknown type: $ ( $Arg.GetType ()) "
585
+ }
586
+ }
587
+
588
+ & $Name $Platform @SplatArgs
567
589
568
590
if ($Summary ) {
569
591
Add-TimingData $Platform $Name $Stopwatch.Elapsed
@@ -3273,9 +3295,7 @@ if (-not $IsCrossCompiling) {
3273
3295
" -TestLLVM" = $Test -contains " llvm" ;
3274
3296
" -TestSwift" = $Test -contains " swift" ;
3275
3297
}
3276
- Write-Host " `$ HostPlatform = $ ( $HostPlatform | ConvertTo-Json ) " - ForegroundColor Blue
3277
- Write-Host " `$ Tests = $ ( $Tests ) " - ForegroundColor Magenta
3278
- Invoke-BuildStep Build-Compilers $HostPlatform @Tests
3298
+ Invoke-BuildStep Build-Compilers $HostPlatform $Tests
3279
3299
}
3280
3300
3281
3301
if ($Test -contains " dispatch" ) { Invoke-BuildStep Test-Dispatch }
0 commit comments