Skip to content

Commit 0aa5268

Browse files
Add SDKs param to script allowing building a subset of architectures
Add Archs param to script defaulting to all architectures.
1 parent ba0eae3 commit 0aa5268

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

build.ps1

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Copyright 2020 Saleem Abdulrasool <[email protected]>
22
# Copyright 2023 Tristan Labelle <[email protected]>
33

4+
param(
5+
[string[]] $SDKs = @("X64","X86","Arm64")
6+
)
7+
48
$ErrorActionPreference = "Stop"
59
Set-StrictMode -Version 3.0
610

@@ -50,6 +54,16 @@ $HostArch = switch (${Env:PROCESSOR_ARCHITECTURE}) {
5054
default { $ArchX64 }
5155
}
5256

57+
# Resolve the architectures received as argument
58+
$SDKArchs = $SDKs | ForEach-Object {
59+
switch ($_) {
60+
"X64" { $ArchX64 }
61+
"X86" { $ArchX86 }
62+
"Arm64" { $ArchArm64 }
63+
default { throw "Unknown architecture $_" }
64+
}
65+
}
66+
5367
$CurrentVSDevShellTargetArch = $null
5468

5569
$InitialEnvPaths = @{
@@ -902,7 +916,7 @@ function Build-SourceKitLSP($Arch)
902916

903917
Build-Compilers $HostArch
904918

905-
foreach ($Arch in $ArchX64,$ArchX86,$ArchARM64)
919+
foreach ($Arch in $SDKArchs)
906920
{
907921
Build-ZLib $Arch
908922
Build-XML2 $Arch

0 commit comments

Comments
 (0)